<?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>Hooked prefs won&#039;t get stored</title> 
  <pubDate>Fri, 10 Apr 2026 12:52:13 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/6822</link> 
  <atom:link rel="self" type="application/rss+xml" title="Hooked prefs won&#039;t get stored" href="https://bugs.horde.org/ticket/6822/rss" /> 
  <description>Hooked prefs won&#039;t get stored</description> 
 
   
   
  <item> 
   <title>Hooked and non-locked prefs won&#039;t get stored any more.



/ </title> 
   <description>Hooked and non-locked prefs won&#039;t get stored any more.



/ manuel



Patch:

--- ./lib/Horde/Prefs.php.orig  2008-06-02 22:49:59.000000000 +0200

+++ ./lib/Horde/Prefs.php       2008-06-02 22:57:34.000000000 +0200

@@ -766,6 +766,7 @@

                 $this-&gt;_scopes[$scope][$name][&#039;m&#039;] &amp; _PREF_DEFAULT) {

                 $val = Horde::callHook(&#039;_prefs_hook_&#039; . $name, array($this-&gt;_user), &#039;horde&#039;, $name);

                 $this-&gt;_scopes[$scope][$name][&#039;v&#039;] = $this-&gt;convertToDriver($val, NLS::getCharset());

+                $this-&gt;_scopes[$scope][$name][&#039;m&#039;] |= _PREF_DIRTY;

             }

         }

     }</description> 
   <pubDate>Mon, 02 Jun 2008 21:03:28 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6822#t45830</link> 
  </item> 
   
  <item> 
   <title>Why isn&#039;t this the right behavior?</title> 
   <description>Why isn&#039;t this the right behavior?</description> 
   <pubDate>Tue, 03 Jun 2008 02:05:56 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6822#t45845</link> 
  </item> 
   
  <item> 
   <title>&gt; Why isn&#039;t this the right behavior?



#1 It&#039;s not document</title> 
   <description>&gt; Why isn&#039;t this the right behavior?



#1 It&#039;s not documented that way (from hooks.php)

 * NOTE 3: Any preference that is NOT LOCKED, that is set by a hook, WILL BE

 * SAVED WITH THAT VALUE. This means several things:

 * 1) Users will get the results of the hook set for them in their

 *    preferences.

 * 2) By virtue of this, the next time they log in and load their

 *    preferences, the hook will NOT be called, because in their last session,

 *    we saved the results of the hook for them. However, if the preference is

 *    locked, the result of the hook will never be saved.



#2 We&#039;re hooking a lot of preferences for initial setup. If they won&#039;t be stored any more, this will generate a bunch of unnecessary SQL querys.



#3 Why should unlocked prefs not get stored? (counter question)</description> 
   <pubDate>Tue, 03 Jun 2008 08:14:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6822#t45864</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.192&amp;r2=1.193&amp;ty=u
http://cvs.horde.org/diff.php/horde/docs/CHANGES?r1=1.1100&amp;r2=1.1101&amp;ty=u</description> 
   <pubDate>Sun, 08 Jun 2008 15:53:32 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6822#t46094</link> 
  </item> 
   
  <item> 
   <title>True enough. I fixed the patch to only store if the pref is </title> 
   <description>True enough. I fixed the patch to only store if the pref is unlocked and committed it - thanks.</description> 
   <pubDate>Sun, 08 Jun 2008 15:53:58 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6822#t46095</link> 
  </item> 
   
  <item> 
   <title>It&#039;s been a while, but I just found out that your fix is not</title> 
   <description>It&#039;s been a while, but I just found out that your fix is not correct.

Your fix add the dirty bit to locked preferences. But in fact it should mark them if they are NOT locked. So please negate the if condition.

</description> 
   <pubDate>Sun, 25 Jan 2009 16:02:08 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6822#t51952</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?rt=horde&amp;r1=1.196&amp;r2=1.197&amp;ty=u
http://cvs.horde.org/diff.php/horde/docs/CHANGES?rt=horde&amp;r1=1.1201&amp;r2=1.1202&amp;ty=u</description> 
   <pubDate>Wed, 04 Feb 2009 21:45:21 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6822#t52278</link> 
  </item> 
   
  <item> 
   <title>Thanks for the catch.</title> 
   <description>Thanks for the catch.</description> 
   <pubDate>Wed, 04 Feb 2009 21:46:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6822#t52279</link> 
  </item> 
   
  <item> 
   <title>! (not) has higher precedence than bitwise &amp;, so there shoul</title> 
   <description>! (not) has higher precedence than bitwise &amp;, so there should be brackets too.

if (!($this-&gt;_scopes[$scope][$name][&#039;m&#039;] &amp; _PREF_LOCKED)) { ... }

</description> 
   <pubDate>Thu, 05 Feb 2009 12:38:08 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6822#t52298</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?rt=horde&amp;r1=1.197&amp;r2=1.198&amp;ty=u</description> 
   <pubDate>Thu, 05 Feb 2009 20:59:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6822#t52307</link> 
  </item> 
   
  <item> 
   <title>*sigh*, thanks</title> 
   <description>*sigh*, thanks</description> 
   <pubDate>Thu, 05 Feb 2009 21:00:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6822#t52308</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
