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.

CommentFileSizeAuthor
#2 file-theme-setting-2771121-1.patch590 bytesAlterEgo7

Comments

AlterEgo7 created an issue. See original summary.

AlterEgo7’s picture

StatusFileSize
new590 bytes

  • markcarver committed 937e5f9 on 8.x-3.x authored by AlterEgo7
    Issue #2771121 by AlterEgo7: Managed file theme setting not update...
markhalliwell’s picture

Status: Active » Fixed

I 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!

  • markcarver committed 793eb2f on 8.x-3.x
    Issue #2771121 by AlterEgo7, markcarver: Managed file theme setting not...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.