aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-06-02 07:33:19 -0700
committerCash Costello <cash.costello@gmail.com>2012-06-02 07:33:19 -0700
commit912bcd65be8fb4b12aef4b78e8e9fa5ad68fc412 (patch)
treea70fa13d14f6ae3717556dc4824207e3f05a0605 /engine
parentb43e6c7d5550aef3d319148de37fa49cadc33855 (diff)
parent07b6df3d3d5a4b4724d1c573543b67b98a80fd65 (diff)
downloadelgg-912bcd65be8fb4b12aef4b78e8e9fa5ad68fc412.tar.gz
elgg-912bcd65be8fb4b12aef4b78e8e9fa5ad68fc412.tar.bz2
Merge pull request #237 from mrclay/4481_18
Fixes #4481: In can_edit_extender, correctly pass entity to permissions hook.
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/extender.php5
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);
}