ryancramerdesign / ProcessWireConfig

Enables you to customize most ProcessWire config settings from the admin, plus create your own.
9 stars 0 forks source link

Settings being saved to config.json but not being applied #2

Open tyssen opened 9 years ago

tyssen commented 9 years ago

I've just installed this on my testing site which I've also just upgraded to 2.5.26.

When I update settings under the core tab, they get added to config.json and I can also see them listed under the remove tab, but when the page refreshes, all the settings listed under the core tab are as they were before I changed them, e.g. if I tick 'enable debug mode', after submitting, the checkbox is unticked again, although config.json has "debug": true.

But it also seems like the settings aren't actually being applied either. For instance, I'm trying out the useHoverActions mentioned in the latest blog post and it only works if I add:

$config->pageList = array(
'limit' => 50, 
'speed' => 200, 
'useHoverActions' => true,
'hoverActionDelay' => 250, 
'hoverActionFade' => 150
);

to config.php and then comment out:

if(($f = $config->paths->assets . "config/config.json") && is_readable($f)) {
    if($a = json_decode(file_get_contents($f), true)) $config->setArray($a);
}

In config.json I've got:

"pageList": [
    "limit = 50",
    "speed = 200",
    "useHoverActions = 1",
    "hoverActionDelay = 250",
    "hoverActionFade = 150"
]
ryancramerdesign commented 9 years ago

I can't duplicate debug mode not getting retained, but I was able to duplicate the issue with pageList. I have just pushed a fix for that. It was not properly converting associative arrays, like pageList and a couple other config settings require. To fix, install the latest version and go into Setup > Config, and submit to re-save. As for debug mode, my best guess is that something else is disabling debug mode, unless you see other settings not getting retained?

tyssen commented 9 years ago

Didn't read the notes properly and it's because I had debugIf enabled too which is why the box keeps getting unticked. :/

But the update does seem to have sorted out my issues with pageList and other settings are now being saved OK too, in both the form and config.json except for upscaling = 1 which shows 1 in the form even though it says false in config.json.

I haven't tested on the front end though to see which setting it's respecting.