Add additional values to the array sent back for file & image type fields only so they populate the fields correctly on context change.
What does it do ?
Checks if a field type is an image or file and sets two additional values in the returned JSON so that form.setValues() can do its job properly.
Why is it needed ?
These fields weren't being repopulated on context change which was leading to oversaving of the default/global value on each save following the main page load. (Main page loads, brings default value, context change does nothing, next save overwrites context value with still-present global/default vale).
Related issue(s)/PR(s)
Let us know if this is related to any issue/pull request
This should resolve #147
Add additional values to the array sent back for file & image type fields only so they populate the fields correctly on context change.
What does it do ?
Checks if a field type is an image or file and sets two additional values in the returned JSON so that form.setValues() can do its job properly.
Why is it needed ?
These fields weren't being repopulated on context change which was leading to oversaving of the default/global value on each save following the main page load. (Main page loads, brings default value, context change does nothing, next save overwrites context value with still-present global/default vale).
Related issue(s)/PR(s)
Let us know if this is related to any issue/pull request This should resolve #147