From 8d4991a71234a530088dde55771f43b20fff7dad Mon Sep 17 00:00:00 2001 From: Patrick Nelson Date: Mon, 5 Nov 2018 20:01:29 -0800 Subject: [PATCH 1/2] Revert "ENHANCEMENT: Fix bug that requires two clicks on save in some situations" This reverts commit 245caaff2abc95e7037d6160b79eae9f4e2926e5. --- code/extensions/GridFieldBetterButtonsItemRequest.php | 1 - javascript/gridfield_betterbuttons.js | 11 +---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/code/extensions/GridFieldBetterButtonsItemRequest.php b/code/extensions/GridFieldBetterButtonsItemRequest.php index 16af597..c480554 100755 --- a/code/extensions/GridFieldBetterButtonsItemRequest.php +++ b/code/extensions/GridFieldBetterButtonsItemRequest.php @@ -103,7 +103,6 @@ public function updateItemEditForm($form) { $utils = $this->owner->record->getBetterButtonsUtils(); $form->Utils = $this->filterFieldList($form, $utils); $form->setTemplate('BetterButtons_EditForm'); - $form->addExtraClass('better-buttons-form'); } diff --git a/javascript/gridfield_betterbuttons.js b/javascript/gridfield_betterbuttons.js index cb1ba4a..29f3a1d 100755 --- a/javascript/gridfield_betterbuttons.js +++ b/javascript/gridfield_betterbuttons.js @@ -25,15 +25,6 @@ $.entwine('ss', function($) { } this._super(e); } - }); - - // This kills the publish/save button switch that happens on blur in CMSMain. - $('.better-buttons-form.cms-edit-form.changed').entwine({ - onmatch: function(e) { - }, - onunmatch: function(e) { - } - }); - + }) }); })(jQuery); \ No newline at end of file From 33a6fcc75f3bd37eaa7dc72809eaef2e6bb242b2 Mon Sep 17 00:00:00 2001 From: Patrick Nelson Date: Mon, 5 Nov 2018 20:04:07 -0800 Subject: [PATCH 2/2] Ensure better parity with SiteTree and reflect changes in "Publish" button in case draft isn't consistent with live version (ALSO the case if "record is deleted from stage", i.e. draft doesn't exist) --- code/buttons/BetterButton_Publish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/buttons/BetterButton_Publish.php b/code/buttons/BetterButton_Publish.php index e4c1e4d..6bcfb71 100755 --- a/code/buttons/BetterButton_Publish.php +++ b/code/buttons/BetterButton_Publish.php @@ -54,7 +54,7 @@ public function transformToButton() { $this->setTitle(_t('SiteTree.BUTTONPUBLISHED', 'Published')); } - if($this->gridFieldRequest->record->stagesDiffer('Stage','Live') && $this->gridFieldRequest->recordIsDeletedFromStage()) { + if($this->gridFieldRequest->record->stagesDiffer('Stage','Live')) { $this->addExtraClass('ss-ui-alternate'); }