Skip to content

Commit

Permalink
Merge branch 'MDL-61836-master-order' of git://github.com/andrewnicol…
Browse files Browse the repository at this point in the history
…s/moodle
  • Loading branch information
stronk7 committed Apr 20, 2018
2 parents 11f0704 + 7072009 commit 1bcbbe3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion blog/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public static function export_user_data(approved_contextlist $contextlist) {
// Loop over each blog entry in context.
$sql = "userid = :userid AND module IN (:blog, :blogext) AND id $insql";
$params = array_merge($inparams, ['userid' => $contextuserid, 'blog' => 'blog', 'blogext' => 'blog_external']);
$recordset = $DB->get_recordset_select('post', $sql, $params);
$recordset = $DB->get_recordset_select('post', $sql, $params, 'id');
foreach ($recordset as $record) {

$subject = format_string($record->subject);
Expand Down
13 changes: 11 additions & 2 deletions blog/tests/privacy_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,17 @@ public function test_export_data_for_user() {

$comments = $writer->get_data($commentpath);
$this->assertCount(2, $comments->comments);
$this->assertEquals('Hello, it\'s me!', strip_tags($comments->comments[0]->content));
$this->assertEquals('I was wondering if after', strip_tags($comments->comments[1]->content));

$c0 = strip_tags($comments->comments[0]->content);
$c1 = strip_tags($comments->comments[1]->content);
$expectedcomments = [
'Hello, it\'s me!',
'I was wondering if after',
];

$this->assertNotFalse(array_search($c0, $expectedcomments));
$this->assertNotFalse(array_search($c1, $expectedcomments));
$this->assertNotEquals($c0, $c1);

} else {
$tagdata = $writer->get_related_data($path, 'tags');
Expand Down

0 comments on commit 1bcbbe3

Please sign in to comment.