Skip to content

Commit

Permalink
fix(upgrade): Corrected the way ignore access and show hidden entitie…
Browse files Browse the repository at this point in the history
…s is applied
  • Loading branch information
Srokap committed Apr 7, 2014
1 parent 3aae56b commit ccec25a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
add_subtype('object', 'comment', 'ElggComment');
}

$access_status = access_get_show_hidden_status();
access_show_hidden_entities(true);
$ia = elgg_set_ignore_access(true);

// add ElggUpgrade object if need to migrate comments
$options = array(
'annotation_names' => 'generic_comment',
Expand All @@ -26,13 +30,12 @@
);

if (elgg_get_annotations($options)) {
$ia = elgg_set_ignore_access(true);

$upgrade = new ElggUpgrade();
$upgrade->setURL("admin/upgrades/comments");
$upgrade->title = 'Comments Upgrade';
$upgrade->description = 'Comments have been improved in Elgg 1.9 and require a migration. Run this upgrade to complete the migration.';
$upgrade->save();
}

elgg_set_ignore_access($ia);
}
elgg_set_ignore_access($ia);
access_show_hidden_entities($access_status);
2 changes: 2 additions & 0 deletions mod/groups/upgrades/2013100401.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
*/

$access_status = access_get_show_hidden_status();
access_show_hidden_entities(true);
$ia = elgg_set_ignore_access(true);

$discussion_replies = elgg_get_annotations(array(
'annotation_names' => 'group_topic_post',
));
Expand Down

0 comments on commit ccec25a

Please sign in to comment.