From 4e3d6f9118827ac2e47f867882bbebb4b031fbda Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 22 Dec 2015 14:29:29 +1300 Subject: [PATCH] Fix merge regressions from 3.2 -> 3 --- admin/javascript/LeftAndMain.BatchActions.js | 2 +- forms/HtmlEditorField.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/javascript/LeftAndMain.BatchActions.js b/admin/javascript/LeftAndMain.BatchActions.js index 36a525e93..d6ce239aa 100644 --- a/admin/javascript/LeftAndMain.BatchActions.js +++ b/admin/javascript/LeftAndMain.BatchActions.js @@ -181,7 +181,7 @@ } // If no action is selected, enable all nodes - if(!actionURL || actionURL == -1 || !viewMode.hasClass('active')) { + if(!actionUrl || actionUrl == -1 || !viewMode.hasClass('active')) { $(rootNode).find('li').each(function() { $(this).setEnabled(true); }); diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php index 8b7634d67..8960a8d7a 100644 --- a/forms/HtmlEditorField.php +++ b/forms/HtmlEditorField.php @@ -470,7 +470,10 @@ class HtmlEditorField_Toolbar extends RequestHandler { protected function viewfile_getLocalFileByURL($fileUrl) { $filteredUrl = Director::makeRelative($fileUrl); + + // Remove prefix and querystring $filteredUrl = Image::strip_resampled_prefix($filteredUrl); + list($filteredUrl) = explode('?', $filteredUrl); $file = File::get()->filter('Filename', $filteredUrl)->first(); @@ -513,6 +516,7 @@ class HtmlEditorField_Toolbar extends RequestHandler { $file = null; $url = null; + // TODO Would be cleaner to consistently pass URL for both local and remote files, // but GridField doesn't allow for this kind of metadata customization at the moment. if($fileUrl = $request->getVar('FileURL')) {