FIX: Prevent tmpl.js include on ajax request

Including tmpl.js from the framework third party directory interfere
with an upload field within a grid field edit form.
This commit is contained in:
Mohamed Alsharaf 2018-11-13 16:37:51 +13:00
parent d88b60a7c2
commit aef80e1aec
1 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,9 @@ class GridFieldAddNewInlineButton implements GridField_HTMLProvider, GridField_S
throw new Exception('Inline adding requires the editable columns component');
}
Requirements::javascript(THIRDPARTY_DIR . '/javascript-templates/tmpl.js');
if (!Director::is_ajax()) {
Requirements::javascript(THIRDPARTY_DIR . '/javascript-templates/tmpl.js');
}
GridFieldExtensions::include_requirements();
$data = new ArrayData(array(