From 59a50dab0b2c8a46af5076266d440934e99778e6 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 8 Jun 2018 12:19:32 +1200 Subject: [PATCH 1/2] Remove obsolete branch-alias --- composer.json | 74 ++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/composer.json b/composer.json index 3cbdc17e..126b3b53 100644 --- a/composer.json +++ b/composer.json @@ -1,37 +1,39 @@ { - "name": "silverstripe/cms", - "type": "silverstripe-module", - "description": "The SilverStripe Content Management System", - "homepage": "http://silverstripe.org", - "license": "BSD-3-Clause", - "keywords": ["silverstripe", "cms"], - "authors": [ - { - "name": "SilverStripe", - "homepage": "http://silverstripe.com" - }, - { - "name": "The SilverStripe Community", - "homepage": "http://silverstripe.org" - } - ], - "require": { - "php": ">=5.3.3", - "composer/installers": "*", - "silverstripe/framework": "~3.4", - "silverstripe/reports": "~3.4", - "silverstripe/siteconfig": "~3.4" - }, - "require-dev": { - "phpunit/phpunit": "^3 || ^4 || ^5" - }, - "extra": { - "branch-alias": { - "3.x-dev": "3.7.x-dev" - } - }, - "autoload": { - "classmap": ["tests/behat/", "code"] - }, - "minimum-stability": "dev" -} + "name": "silverstripe/cms", + "type": "silverstripe-module", + "description": "The SilverStripe Content Management System", + "homepage": "http://silverstripe.org", + "license": "BSD-3-Clause", + "keywords": [ + "silverstripe", + "cms" + ], + "authors": [ + { + "name": "SilverStripe", + "homepage": "http://silverstripe.com" + }, + { + "name": "The SilverStripe Community", + "homepage": "http://silverstripe.org" + } + ], + "require": { + "php": ">=5.3.3", + "composer/installers": "*", + "silverstripe/framework": "~3.4", + "silverstripe/reports": "~3.4", + "silverstripe/siteconfig": "~3.4" + }, + "require-dev": { + "phpunit/phpunit": "^3 || ^4 || ^5" + }, + "extra": [], + "autoload": { + "classmap": [ + "tests/behat/", + "code" + ] + }, + "minimum-stability": "dev" +} \ No newline at end of file From 07112dbb0bbc4bd624e44586ef3faccdcff1acd1 Mon Sep 17 00:00:00 2001 From: Guy Date: Tue, 12 Jun 2018 09:56:14 +1200 Subject: [PATCH 2/2] FIX Remove blind reliance on current versioning stage being valid --- code/model/SiteTree.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 230419d0..e15f5fdf 100755 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -2247,9 +2247,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid ); // "readonly"/viewing version that isn't the current version of the record - $stageOrLiveRecord = Versioned::get_one_by_stage($this->class, Versioned::current_stage(), array( - '"SiteTree"."ID"' => $this->ID - )); + $stageOrLiveRecord = SiteTree::get()->byID($this->ID); if($stageOrLiveRecord && $stageOrLiveRecord->Version != $this->Version) { $moreOptions->push(FormAction::create('email', _t('CMSMain.EMAIL', 'Email'))); $moreOptions->push(FormAction::create('rollback', _t('CMSMain.ROLLBACK', 'Roll back to this version')));