6.0.0-beta1
8/11/25

[#6822] Hooked prefs won't get stored
Summary Hooked prefs won't get stored
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Resolved
Priority 2. Medium
Owners chuck (at) horde (dot) org
Requester manuel (at) mausz (dot) at
Created 06/02/2008 (6279 days ago)
Due
Updated 02/05/2009 (6031 days ago)
Assigned 01/29/2009 (6038 days ago)
Resolved 02/04/2009 (6032 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
02/05/2009 09:00:25 PM Chuck Hagenbuch Comment #11 Reply to this comment
*sigh*, thanks
02/05/2009 08:59:30 PM CVS Commit Comment #10 Reply to this comment
02/05/2009 12:38:08 PM manuel (at) mausz (dot) at Comment #9 Reply to this comment
! (not) has higher precedence than bitwise &, so there should be brackets too.

if (!($this->_scopes[$scope][$name]['m'] & _PREF_LOCKED)) { ... }


02/04/2009 09:46:17 PM Chuck Hagenbuch Comment #8
State ⇒ Resolved
Reply to this comment
Thanks for the catch.
01/29/2009 11:00:02 AM Jan Schneider State ⇒ Assigned
 
01/25/2009 04:02:08 PM manuel (at) mausz (dot) at Comment #6 Reply to this comment
It'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.


06/08/2008 03:53:58 PM Chuck Hagenbuch Comment #5
State ⇒ Resolved
Assigned to Chuck Hagenbuch
Reply to this comment
True enough. I fixed the patch to only store if the pref is unlocked 
and committed it - thanks.
06/03/2008 08:14:52 AM manuel (at) mausz (dot) at Comment #3 Reply to this comment
Why isn't this the right behavior?
#1 It'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're hooking a lot of preferences for initial setup. If they won't 
be stored any more, this will generate a bunch of unnecessary SQL 
querys.



#3 Why should unlocked prefs not get stored? (counter question)
06/03/2008 02:05:56 AM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
Why isn't this the right behavior?
06/02/2008 09:03:28 PM manuel (at) mausz (dot) at Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Hooked prefs won't get stored
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
Hooked and non-locked prefs won'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->_scopes[$scope][$name]['m'] & _PREF_DEFAULT) {

                  $val = Horde::callHook('_prefs_hook_' . $name, 
array($this->_user), 'horde', $name);

                  $this->_scopes[$scope][$name]['v'] = 
$this->convertToDriver($val, NLS::getCharset());

+                $this->_scopes[$scope][$name]['m'] |= _PREF_DIRTY;

              }

          }

      }

Saved Queries