[dev] where the little prefs come from

Sebastian Birnbach birnbacs at gmail.com
Sun Jun 24 12:45:46 UTC 2018


Update:

Horde_Prefs::setValue() checks the scope, which is the application's name.
It is empty for the users where saving does not work and 'horde' (the
default) for those where it does.

How can I set scope for my prefs?

config.local.php reads:

$prefGroups['display'] = array(
    'column' => _("Abakus Prefs"),
    'label' => _("Display Preferences"),
    'desc' => _("display style, which tab to open first etc."),
    'members' => array('opentab', 'numjobs')
);

$_prefs['opentab'] = array(
    'locked' => false,
    'type' => 'enum',
    'enum' => array(
                    'coredata' => _('coredata'),
                    'contacts' => _('contacts'),
                    'notes' => _('notes'),
                    'templates' => _('templates'),
                    'billing' => _('billing'),
                    ),
    'default' => 'coredata',
    'desc' => _("the tab to display when opening a dossier")
);

$_prefs['numjobs'] = array(
    'locked' => false,
    'type' => 'enum',
    'enum' => array(
                    0 => '0',
                    6 => '6',
                    12 => '12',
                    18 => '18',
                    24 => '24',
                    36 => '36',
                    48 => '48',
                    ),
    'default' => '12',
    'desc' => _("how many jobs will be shown in the sidebar")
);



2018-06-24 14:01 GMT+02:00 Sebastian Birnbach <birnbacs at gmail.com>:

> For my own application I created preferences in config/prefs.local.php.
> They show up as user-editable settings for all users but are editable only
> for some.
>
> I found that for those users who can change settings there is a
> corresponding DB entry in the prefs container (SQL table horde_prefs). If
> the entry is missing, saving those prefs fails.
>
> I debugged into /usr/local/share/pear/Horde/Prefs.php#setValue() and see
> that a preference value is not saved if it does not already exist.
>
> So, how are prefs initially created? Is there some priming to be done
> after editing prefs.local.php? And how comes some users' prefs did get
> created?
>
>
> Kind regards
>
>   birnbacs
>
>


More information about the dev mailing list