From bde71c1b9c9eadbd959b6fa7e759526825b257a7 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 25 Sep 2012 22:13:31 +0200 Subject: [PATCH 1/4] Fixing permission issue with CMSSettingsController, where it won't show up for users with limited rights, even when they have the `EDIT_SITECONFIG` permission --- code/controllers/CMSSettingsController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/controllers/CMSSettingsController.php b/code/controllers/CMSSettingsController.php index cb8d0e23..a5000edb 100644 --- a/code/controllers/CMSSettingsController.php +++ b/code/controllers/CMSSettingsController.php @@ -6,7 +6,8 @@ class CMSSettingsController extends LeftAndMain { static $menu_priority = -1; static $menu_title = 'Settings'; static $tree_class = 'SiteConfig'; - + static $required_permission_codes = array('EDIT_SITECONFIG'); + public function getResponseNegotiator() { $neg = parent::getResponseNegotiator(); $controller = $this; From 38f28deafe7bf61549a17ad945f94e6d261773a6 Mon Sep 17 00:00:00 2001 From: Simon Welsh Date: Fri, 21 Sep 2012 15:34:12 +1200 Subject: [PATCH 2/4] Adds Travis testing to the CMS --- .travis.yml | 30 ++++++++++++++++++++++++++++++ tests/travis/before_script | 10 ++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .travis.yml create mode 100755 tests/travis/before_script diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..edfd3405 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +language: php +php: + - 5.3 + - 5.4 + +env: + - TESTDB=MYSQL + - TESTDB=PGSQL + +matrix: + exclude: + - php: 5.4 + env: TESTDB=PGSQL + +before_script: + - ./tests/travis/before_script ~/builds/ss + - cd ~/builds/ss + +script: + - php framework/cli-script.php dev/tests/module/cms + +branches: + except: + - translation-staging + - 2.4 + +notifications: + irc: + channels: + - "irc.freenode.org#silverstripe" diff --git a/tests/travis/before_script b/tests/travis/before_script new file mode 100755 index 00000000..3c1c5928 --- /dev/null +++ b/tests/travis/before_script @@ -0,0 +1,10 @@ +BUILD_DIR=$1 +git clone --depth=100 --quiet git://github.com/silverstripe/silverstripe-installer.git $BUILD_DIR +git clone --depth=100 --quiet git://github.com/silverstripe-labs/silverstripe-sqlite3.git $BUILD_DIR/sqlite3 +git clone --depth=100 --quiet git://github.com/silverstripe/silverstripe-postgresql.git $BUILD_DIR/postgresql +git clone --depth=100 --quiet -b ${TRAVIS_BRANCH:-master} git://github.com/silverstripe/sapphire.git $BUILD_DIR/framework +cp $BUILD_DIR/framework/tests/travis/_ss_environment.php $BUILD_DIR +cp $BUILD_DIR/framework/tests/travis/_config.php $BUILD_DIR/mysite +cp -r . $BUILD_DIR/cms + +cd $BUILD_DIR From 7316f96190fbdd4a3a407f536182361228792b1a Mon Sep 17 00:00:00 2001 From: Robert Curry Date: Tue, 24 Jul 2012 15:59:39 +1200 Subject: [PATCH 3/4] BUG: Only add validation to non-read only URLSegmentField Fix required for Translatable, as it has a read-only URLSegmentField. --- javascript/SiteTreeURLSegmentField.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/SiteTreeURLSegmentField.js b/javascript/SiteTreeURLSegmentField.js index fc0a183b..55599928 100644 --- a/javascript/SiteTreeURLSegmentField.js +++ b/javascript/SiteTreeURLSegmentField.js @@ -5,7 +5,7 @@ * * Input validation on the URLSegment field */ - $('.field.urlsegment').entwine({ + $('.field.urlsegment:not(.readonly)').entwine({ /** * Constructor: onmatch From 9cf5a6f47a97eaef38c510eea7ee43f93bf81902 Mon Sep 17 00:00:00 2001 From: Robert Curry Date: Tue, 24 Jul 2012 16:02:11 +1200 Subject: [PATCH 4/4] BUG: Remove the is_null check on augmentValidURLSegment Object::extend already does a check for NULL before it adds the results to the array of return values. This was required for Translatable as the result from Translatable::augmentValidURLSegment was being ignored. --- code/model/SiteTree.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 06f7c961..40b68973 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -1580,8 +1580,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $votes = $this->extend('augmentValidURLSegment'); if($votes) { - $votes = array_filter((array)$votes, 'is_null'); - if($votes) return min($votes); + return min($votes); } return true;