aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-12-31 15:02:38 -0500
committercash <cash.costello@gmail.com>2011-12-31 15:02:38 -0500
commit050d445fef73bf91968841752d9e1bdb652485f6 (patch)
tree887d34fcf6375a7c4b076e0a42a460d88a86aa2b
parent63dfdab76fef0e44fac550b0bb1a15780470f6c6 (diff)
downloadelgg-050d445fef73bf91968841752d9e1bdb652485f6.tar.gz
elgg-050d445fef73bf91968841752d9e1bdb652485f6.tar.bz2
Fixes #4254 not registering the default widgets callback more than once per event
-rw-r--r--engine/lib/widgets.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index 46f34391a..d73dd6330 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -316,7 +316,12 @@ function elgg_default_widgets_init() {
// override permissions for creating widget on logged out / just created entities
elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'elgg_default_widgets_permissions_override');
+ // only register the callback once per event
+ $events = array();
foreach ($default_widgets as $info) {
+ $events[$info['event'] . ',' . $info['entity_type']] = $info;
+ }
+ foreach ($events as $info) {
elgg_register_event_handler($info['event'], $info['entity_type'], 'elgg_create_default_widgets');
}
}