diff options
author | Steve Clay <steve@mrclay.org> | 2012-05-17 19:32:24 -0400 |
---|---|---|
committer | Steve Clay <steve@mrclay.org> | 2012-05-17 19:32:24 -0400 |
commit | 07b6df3d3d5a4b4724d1c573543b67b98a80fd65 (patch) | |
tree | f590949bb0eafd81e4bd4db63c670d87917f642a /engine | |
parent | 40d35166d3f2211ab76943834a983330413ab761 (diff) | |
download | elgg-07b6df3d3d5a4b4724d1c573543b67b98a80fd65.tar.gz elgg-07b6df3d3d5a4b4724d1c573543b67b98a80fd65.tar.bz2 |
Fixes #4481: In can_edit_extender, correctly pass entity to permissions hook. Also fixes missing attribute name in ProblemUpdatingMeta import exception.
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/extender.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/engine/lib/extender.php b/engine/lib/extender.php index ffd3c1357..43421342c 100644 --- a/engine/lib/extender.php +++ b/engine/lib/extender.php @@ -105,6 +105,7 @@ function import_extender_plugin_hook($hook, $entity_type, $returnvalue, $params) // Save if (!$entity->save()) { + $attr_name = $element->getAttribute('name'); $msg = elgg_echo('ImportException:ProblemUpdatingMeta', array($attr_name, $entity_uuid)); throw new ImportException($msg); } @@ -120,7 +121,7 @@ function import_extender_plugin_hook($hook, $entity_type, $returnvalue, $params) * @param string $type 'metadata' or 'annotation' * @param int $user_guid The GUID of the user * - * @return true|false + * @return bool */ function can_edit_extender($extender_id, $type, $user_guid = 0) { if (!elgg_is_logged_in()) { @@ -155,7 +156,7 @@ function can_edit_extender($extender_id, $type, $user_guid = 0) { } // Trigger plugin hooks - $params = array('entity' => $entity, 'user' => $user); + $params = array('entity' => $extender->getEntity(), 'user' => $user); return elgg_trigger_plugin_hook('permissions_check', $type, $params, false); } |