If you add a managed file Setting plugin (eg. for adding a custom background image) to the bootstrap settings, the SystemThemeSettings::submitForm method check if each of the registered settings has an update value before actually saving it.
The value override check is implemented in ThemeSettings::overridesValue and relies on Drupal's DiffArray and the result is cast to boolean.
If you have uploaded a file and the choose to remove it, the managed file field returns an empty array. When DiffArray checks the differences it returns an empty array that denotes however the new value in $array1 and not that the 2 arrays are equal. So even though the value is changed, the boolean casts to FALSE making the file unremovable.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | file-theme-setting-2771121-1.patch | 590 bytes | AlterEgo7 |
Comments
Comment #2
AlterEgo7 commentedComment #4
markhalliwellI ended up modifying the patch a bit to clean up some syntax and add a description for why this is needed. I still credited you though since you came up with the solution. Thanks @AlterEgo7!