Struggling to get to be bottom of an odd bug after updating from 4.6.1 to 4.7.1:
In any page Settings, the “Viewer Groups” field and (in certain circumstances) the “Parent page” field do not pre-populate with the current value, meaning the value is wiped when saving the page.
The issue goes away when I downgrade to 4.6.1, but only seems to occur in particular environments, i.e. I can’t reproduce it locally.
For the “Parent page” field, the issue only seems to occur if the page is on the 3rd level.
Does anyone have an idea what could be causing this?
I too have experienced this in theTreeDropdownField. This is occurring where ever an internal Page Selection is required, e,g, RedirectorPage, Links module.
Client has to currently use the External Website field to avoid the dropdown clearing whenever the page is published.
Ah yes, I can reproduce it with the TreeDropdownField on Redirector Page too. Seems fine when selecting a top-level page, but upon selecting a second-level page and clicking save, the dropdown becomes empty.
I just connected my local install to my remote database, and the issue still didn’t occur locally. So this would indicate it is not related to the database.
The reason it doesn’t work remotely but does locally, is because json_encode is wrapping numeric values in quotes on the remote server, but on the local setup it doesn’t wrap these values in quotes.
This causes the following difference in the data-state attribute for TreeDropDown fields:
local: "value":656,
remote: "value":"656",
It seems to be that up until 4.7.0, this didn’t matter, and that even with the quotes, the value would get parsed correctly, but something appears to have changed in 4.7.0 which has stopped it from being able to parse the numeric values when wrapped in quotes.
I’m yet to work out:
What changed in Silverstripe 4.7.0 to cause this.
Why json_encode performs differently on local vs remote.