sheadawson/silverstripe-select2

Conflicts with uploadfield

Opened this issue · 1 comments

When an AjaxSelect2Field is present, the upload field will not load. A workaround is possible where resizing the screen, or opening a dropdown field will trigger the entwine redraw.

When saving a page that has both an upload field and an AjaxSelect2Field, once the save has occurred, only the upload field will be displayed, and a page refresh is required to show the AjaxSelect2Field (at which point, the upload field is no longer shown).

It appears that removing...

Requirements::javascript('silverstripe/admin: thirdparty/jquery/jquery.js');
Requirements::javascript('silverstripe/admin: thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');

...from public function Field($properties = array()) on the AjaxSelect2Field class resolves this issue.

I imagine the issue is likely to be present for the other field types, but as this is the only instance used on my project, it's the only one I have encountered.

This should be an issue with all field types (as jQuery and Entwine are included in each field). A simple workaround (without modifying the library) is blocking the Requirements in the _config.php:

Requirements::block('silverstripe/admin: thirdparty/jquery/jquery.js');
Requirements::block('silverstripe/admin: thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');