6.0.0-beta1
10/19/25

[#4148] preferences hooks get called multiple times
Summary preferences hooks get called multiple times
Queue Horde Base
Queue Version 3.1.1
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester dgehl (at) inverse (dot) ca
Created 07/12/2006 (7039 days ago)
Due
Updated 07/12/2006 (7039 days ago)
Assigned
Resolved 07/12/2006 (7039 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
07/12/2006 04:23:59 PM Michael Slusarz Comment #4
State ⇒ Not A Bug
Priority ⇒ 1. Low
Reply to this comment
This bug seems to be fixed in horde-3.1.2
Exactly.  This was surely an offshoot of prefs caching being broken 
(and subsequently fixed for 3.1.2).
07/12/2006 04:13:51 PM dgehl (at) inverse (dot) ca Comment #3 Reply to this comment
This bug seems to be fixed in horde-3.1.2
07/12/2006 04:12:18 PM dgehl (at) inverse (dot) ca Comment #2 Reply to this comment
Adding to line 723 of lib/Horde/Prefs.php (inside the _callHooks 
function) the following code

Horde::logMessage("calling " . $pref . " hook for user " . 
$this->_user, __FILE__, __LINE__, PEAR_LOG_INFO);

allows to easily follow the number of times the hook is executed




07/12/2006 01:49:33 PM dgehl (at) inverse (dot) ca Comment #1
State ⇒ Unconfirmed
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ preferences hooks get called multiple times
Queue ⇒ Horde Base
Reply to this comment
I defined the '_prefs_hook_fullname' function in config/hooks.php and 
according to config/hooks.php.dist,



Preferences hooks are ONLY executed on login. Preferences are

  * cached during a users session and, to avoid unnecessary overhead every time

  * a preference is accessed, the results of hooks are cached as well.



Unfortunately, I noticed that for any given user, the 
'_prefs_hook_fullname' function gets executed several times (approx. 
once per second) !



I have in config/prefs.php



$_prefs['fullname'] = array(

     'hook' => true,

     'value' => '',

     'locked' => true,

     'shared' => true,

     'type' => 'text',

     'desc' => _("Your full name:")

);





and in confi/conf.php



$conf['prefs']['params']['driverconfig'] = 'horde';

$conf['prefs']['driver'] = 'sql';


Saved Queries