richardhj / contao-ajax_reload_element

AjaxReloadElement for Contao Open Source CMS
GNU Lesser General Public License v3.0
14 stars 5 forks source link

Modify palettes in onload_callback #21

Closed fritzmg closed 3 years ago

fritzmg commented 3 years ago

Currently certain module or content elements will not have the ajax reload checkbox from bundles that might get loaded after the RichardhjContaoAjaxReloadElementBundle. This currently includes the contao/calendar-bundle for example - so there is no ajax reload checkbox in the modules of the Calendar Bundle.

This PR fixes this by modifying the palette in an onload_callback instead, ensuring that all palettes are already defined at that point (minus palettes that are themselves added in an onload_callback, but that's an edge case anyway and can be solved later on when increasing the minimum Contao version to 4.9 by using service tagging and a priority).

richardhj commented 3 years ago

I guess I've done this method once before, so LGTM :-)