From c8bbc359656ced62de84511bb7bd8cb304609abb Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 8 Oct 2011 18:33:37 -0400 Subject: Fixes #3743 returning bool instead of int when setting a private setting --- engine/classes/ElggPlugin.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'engine/classes/ElggPlugin.php') diff --git a/engine/classes/ElggPlugin.php b/engine/classes/ElggPlugin.php index 4aee1e898..c4d6ec034 100644 --- a/engine/classes/ElggPlugin.php +++ b/engine/classes/ElggPlugin.php @@ -264,8 +264,6 @@ class ElggPlugin extends ElggObject { /** * Returns a plugin setting * - * @todo These need to be namespaced - * * @param string $name The setting name * @return mixed */ @@ -318,7 +316,6 @@ class ElggPlugin extends ElggObject { * Set a plugin setting for the plugin * * @todo This will only work once the plugin has a GUID. - * @todo These need to be namespaced. * * @param string $name The name to set * @param string $value The value to set @@ -329,13 +326,6 @@ class ElggPlugin extends ElggObject { if (!$this->guid) { return false; } - // Hook to validate setting - $value = elgg_trigger_plugin_hook('setting', 'plugin', array( - 'plugin_id' => $this->pluginID, - 'plugin' => $this, - 'name' => $name, - 'value' => $value - ), $value); return $this->set($name, $value); } @@ -902,7 +892,9 @@ class ElggPlugin extends ElggObject { } /** - * Save a value to private settings. + * Save a value as private setting or attribute. + * + * Attributes include title and description. * * @param string $name Name * @param mixed $value Value @@ -920,6 +912,14 @@ class ElggPlugin extends ElggObject { return true; } else { + // Hook to validate setting + $value = elgg_trigger_plugin_hook('setting', 'plugin', array( + 'plugin_id' => $this->pluginID, + 'plugin' => $this, + 'name' => $name, + 'value' => $value + ), $value); + return $this->setPrivateSetting($name, $value); } } -- cgit v1.2.3