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')) {