6.0.0-git
2019-04-22

[#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 2008-06-02 (3976 days ago)
Due
Updated 2009-02-05 (3728 days ago)
Assigned 2009-01-29 (3735 days ago)
Resolved 2009-02-04 (3729 days ago)
Milestone
Patch No

History
2009-02-05 21:00:25 Chuck Hagenbuch Comment #11 Reply to this comment
*sigh*, thanks
2009-02-05 20:59:30 CVS Commit Comment #10 Reply to this comment
2009-02-05 12:38:08 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)) { ... }


2009-02-04 21:46:17 Chuck Hagenbuch Comment #8
State ⇒ Resolved
Reply to this comment
Thanks for the catch.
2009-01-29 11:00:02 Jan Schneider State ⇒ Assigned
 
2009-01-25 16:02:08 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.


2008-06-08 15:53:58 Chuck Hagenbuch Comment #5
Assigned to Chuck Hagenbuch
State ⇒ Resolved
Reply to this comment
True enough. I fixed the patch to only store if the pref is unlocked 
and committed it - thanks.
2008-06-03 08:14:52 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)
2008-06-03 02:05:56 Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
Why isn't this the right behavior?
2008-06-02 21:03:28 manuel (at) mausz (dot) at Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ Hooked prefs won't get stored
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
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