<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>_callHooks($scope) always looks for hooks in &#039;horde&#039; scope</title> 
  <pubDate>Fri, 10 Apr 2026 00:02:41 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7445</link> 
  <atom:link rel="self" type="application/rss+xml" title="_callHooks($scope) always looks for hooks in &#039;horde&#039; scope" href="https://bugs.horde.org/ticket/7445/rss" /> 
  <description>_callHooks($scope) always looks for hooks in &#039;horde&#039; scope</description> 
 
   
   
  <item> 
   <title>I have a preference and a hook in the &#039;imp&#039; scope but the ho</title> 
   <description>I have a preference and a hook in the &#039;imp&#039; 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 &#039;horde&#039; scope, not in the scope specified by the $scope parameter.

I&#039;ve created a simple patch [see attachment] and all seems to work fine after it.



the definition of preference [imp/config/prefs.php]:

$_prefs[&#039;my_pref&#039;] = array(

    &#039;type&#039; =&gt; &#039;checkbox&#039;,

    &#039;value&#039; =&gt; true,

    &#039;locked&#039; =&gt; false,

    &#039;shared&#039; =&gt; false,

    &#039;type&#039; =&gt; &#039;checkbox&#039;,

    &#039;hook&#039; =&gt; true,

    &#039;desc&#039; =&gt; _(&quot;Sample&quot;));



the definition of hook [imp/config/hooks.php]:

if (!function_exists(&#039;_prefs_hook_my_pref&#039;)) {

    function _prefs_hook_my_pref() {

        Horde::logMessage(&#039;HOOK FOR MY_PREF&#039;, __FILE__, __LINE__, PEAR_LOG_DEBUG);

        return 0;

    }

}

</description> 
   <pubDate>Tue, 07 Oct 2008 02:58:28 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7445#t49415</link> 
  </item> 
   
  <item> 
   <title>This is a historical leftover. Preference hooks have always </title> 
   <description>This is a historical leftover. Preference hooks have always been in Horde&#039;s hooks.php before version 3.3.</description> 
   <pubDate>Tue, 07 Oct 2008 13:50:07 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7445#t49478</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/framework/Prefs/Prefs.php?r1=1.194&amp;r2=1.195&amp;ty=u
http://cvs.horde.org/diff.php/horde/docs/CHANGES?r1=1.1169&amp;r2=1.1170&amp;ty=u</description> 
   <pubDate>Thu, 09 Oct 2008 15:51:26 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7445#t49555</link> 
  </item> 
   
  <item> 
   <title>Committed, thanks.</title> 
   <description>Committed, thanks.</description> 
   <pubDate>Thu, 09 Oct 2008 15:53:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7445#t49556</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
