[Tickets #7445] _callHooks($scope) always looks for hooks in 'horde' scope
bugs at horde.org
bugs at horde.org
Tue Oct 7 02:58:28 UTC 2008
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/7445
------------------------------------------------------------------------------
Ticket | 7445
Created By | vlukashov at parallels.com
Summary | _callHooks($scope) always looks for hooks in 'horde'
| scope
Queue | Horde Framework Packages
Version | FRAMEWORK_3
Type | Bug
State | Unconfirmed
Priority | 2. Medium
Milestone |
Patch | 1
Owners |
+New Attachment | callHooks.patch
------------------------------------------------------------------------------
vlukashov at parallels.com (2008-10-06 22:58) wrote:
I have a preference and a hook in the 'imp' scope but the hook is not
called. A log entry in Horde::callHook() [lib/Horde.php] showed that
the hook just is not found. Futher investigation brought me to the
_callHooks($scope) method in the Prefs class [lib/Horde/Prefs.php]. It
looks strange that the method always calls hooks in the 'horde' scope,
not in the scope specified by the $scope parameter.
I've created a simple patch [see attachment] and all seems to work
fine after it.
the definition of preference [imp/config/prefs.php]:
$_prefs['my_pref'] = array(
'type' => 'checkbox',
'value' => true,
'locked' => false,
'shared' => false,
'type' => 'checkbox',
'hook' => true,
'desc' => _("Sample"));
the definition of hook [imp/config/hooks.php]:
if (!function_exists('_prefs_hook_my_pref')) {
function _prefs_hook_my_pref() {
Horde::logMessage('HOOK FOR MY_PREF', __FILE__, __LINE__,
PEAR_LOG_DEBUG);
return 0;
}
}
More information about the bugs
mailing list