Skip to content

Commit

Permalink
chore: push widgets context around lazy loaded widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalsem committed Dec 11, 2020
1 parent 1d33921 commit eb2175f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions actions/widget_manager/lazy_load_widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
elgg_set_page_owner_guid($page_owner_guid);
}

$old_context_stack = elgg_get_context_stack();
$context_stack = (array) get_input('context_stack');
if (!empty($context_stack)) {
elgg_set_context_stack($context_stack);
}

elgg_push_context('widgets');

$entities = elgg_get_entities([
'guids' => $guids,
'type' => 'object',
Expand All @@ -28,4 +31,7 @@
$result[$entity->guid] = elgg_view('object/widget/body', ['entity' => $entity]);
}

elgg_pop_context();
elgg_set_context_stack($old_context_stack);

return elgg_ok_response($result);

0 comments on commit eb2175f

Please sign in to comment.