[horde] change hook not working
LALOT Dominique
dom.lalot at gmail.com
Fri Mar 20 16:11:10 UTC 2009
Hello,
I found that it's a form problem. Both values initial_application and
show_sidebar are in the same prefs.
So I change, then the value is changed back as it's in the same form. I
need to get rid of that prefs without locking it.
Dom
LALOT Dominique a écrit :
> Hello,
>
> I've tried various ways, as I didn't get help from a previous post.
>
> I want to say:
> if initial_application == 'dimp' then show_sidebar = false
>
> I tried in the hook: can't call the prefs here..
> I tried in postauthenticate, but they are not red here
>
> So I tried this:
>
> if (!function_exists('_prefs_change_hook_initial_application')) {
> function _prefs_change_hook_initial_application()
> {
> $initapp=$GLOBALS['prefs']->getValue('initial_application');
> Horde::logMessage("tracedom showsidebar app=$initapp", __FILE__, __LINE__,
> PEAR_LOG_NOTICE);
> if (strcmp($initapp,'dimp')==0){
> $GLOBALS['prefs']->setValue('show_sidebar',false);
> Horde::logMessage("tracedom DIMP app=$initapp", __FILE__,
> __LINE__, PEAR_LOG_NOTICE);
> }
> else
> $GLOBALS['prefs']->setValue('show_sidebar',true);
> }
> }
>
> As I understand, if we change initial_application the sidebar value will
> change. And I got that:
> Mar 20 16:24:43 testDom HORDE[7107]: [horde] tracedom showsidebar app=dimp
> [pid 7107 on line 241 of
> "/var/www/perso/horde-webmail-1.2.2/config/hooks.php"]
> Mar 20 16:24:43 testDom HORDE[7107]: [horde] tracedom DIMP app=dimp [pid
> 7107 on line 244 of "/var/www/perso/horde-webmail-1.2.2/config/hooks.php"]
>
> So, the hook is working. But guess what, nothing has changed in the
> database.
>
> Sometimes I can see that:
> Mar 20 16:20:52 testDom HORDE[7105]: [horde] Hook
> _prefs_change_hook_show_sidebar in application horde not called. [pid 7105
> on line 1688 of "/var/www/perso/horde-webmail-1.2.2/lib/Horde.php"]
> Mar 20 16:20:52 testDom HORDE[7105]: [horde] Hook
> _prefs_change_hook_show_sidebar in application horde not called. [pid 7105
> on line 1688 of "/var/www/perso/horde-webmail-1.2.2/lib/Horde.php"]
>
> called twice asynchronously.. and sometimes not.. Cache?. Should I call
> differently to save the value in database?
>
> Thanks
>
> Dom
>
>
>
More information about the horde
mailing list