[horde] only first initialization of preferences via hooks
Steffen
skhorde at smail.inf.fh-bonn-rhein-sieg.de
Thu Mar 6 07:59:46 UTC 2014
On Wed, 5 Mar 2014, Michael M Slusarz wrote:
> Quoting Steffen <skhorde at smail.inf.fh-bonn-rhein-sieg.de>:
>
>> setValue() does not cause the pref to be marked as "dirty", because
>> "init" is true. Therefore changes made are not committed to the storage
>> backend.
>
> Manually mark the preference as dirty via setDirty() after setting it.
>
> i.e., in prefs_init hook:
>
> $scope_ob->setValue($pref, $value);
> $scope_ob->setDirty($pref, true);
>
> 'init' only prevents the value from being automatically saved via set(). It
> won't prevent an explicit setting of the dirty flag.
Ah cool, the prefs are written to the backend now. :-)
For the archive I needed to change to:
$scope_ob->set($pref, $value);
$scope_ob->setDirty($pref, true);
--
Steffen
More information about the horde
mailing list