mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
Merge pull request #181 from tractorcow/pulls/3.2-compat
Use 3.2 compatible API
This commit is contained in:
commit
831a918f8d
@ -30,5 +30,5 @@ before_script:
|
|||||||
- php ~/travis-support/travis_setup_php54_webserver.php --if-env BEHAT_TEST
|
- php ~/travis-support/travis_setup_php54_webserver.php --if-env BEHAT_TEST
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- "if [ \"$BEHAT_TEST\" = \"\" ]; then phpunit subsites/tests; fi"
|
- "if [ \"$BEHAT_TEST\" = \"\" ]; then vendor/bin/phpunit subsites/tests; fi"
|
||||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @subsites; fi"
|
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @subsites; fi"
|
||||||
|
@ -57,7 +57,7 @@ class FileSubsites extends DataExtension {
|
|||||||
/**
|
/**
|
||||||
* Update any requests to limit the results to the current site
|
* Update any requests to limit the results to the current site
|
||||||
*/
|
*/
|
||||||
public function augmentSQL(SQLSelect $query) {
|
public function augmentSQL(SQLQuery &$query) {
|
||||||
if(Subsite::$disable_subsite_filter) return;
|
if(Subsite::$disable_subsite_filter) return;
|
||||||
|
|
||||||
// If you're querying by ID, ignore the sub-site - this is a bit ugly... (but it was WAYYYYYYYYY worse)
|
// If you're querying by ID, ignore the sub-site - this is a bit ugly... (but it was WAYYYYYYYYY worse)
|
||||||
|
@ -107,7 +107,7 @@ class GroupSubsites extends DataExtension implements PermissionProvider {
|
|||||||
/**
|
/**
|
||||||
* Update any requests to limit the results to the current site
|
* Update any requests to limit the results to the current site
|
||||||
*/
|
*/
|
||||||
public function augmentSQL(SQLSelect $query) {
|
public function augmentSQL(SQLQuery &$query) {
|
||||||
if(Subsite::$disable_subsite_filter) return;
|
if(Subsite::$disable_subsite_filter) return;
|
||||||
if(Cookie::get('noSubsiteFilter') == 'true') return;
|
if(Cookie::get('noSubsiteFilter') == 'true') return;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ class SiteConfigSubsites extends DataExtension {
|
|||||||
/**
|
/**
|
||||||
* Update any requests to limit the results to the current site
|
* Update any requests to limit the results to the current site
|
||||||
*/
|
*/
|
||||||
public function augmentSQL(SQLSelect $query) {
|
public function augmentSQL(SQLQuery &$query) {
|
||||||
if(Subsite::$disable_subsite_filter) return;
|
if(Subsite::$disable_subsite_filter) return;
|
||||||
|
|
||||||
// If you're querying by ID, ignore the sub-site - this is a bit ugly...
|
// If you're querying by ID, ignore the sub-site - this is a bit ugly...
|
||||||
|
@ -25,7 +25,7 @@ class SiteTreeSubsites extends DataExtension {
|
|||||||
/**
|
/**
|
||||||
* Update any requests to limit the results to the current site
|
* Update any requests to limit the results to the current site
|
||||||
*/
|
*/
|
||||||
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null) {
|
public function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) {
|
||||||
if(Subsite::$disable_subsite_filter) return;
|
if(Subsite::$disable_subsite_filter) return;
|
||||||
if($dataQuery->getQueryParam('Subsite.filter') === false) return;
|
if($dataQuery->getQueryParam('Subsite.filter') === false) return;
|
||||||
|
|
||||||
|
@ -14,6 +14,9 @@
|
|||||||
"silverstripe/framework": "~3.2",
|
"silverstripe/framework": "~3.2",
|
||||||
"silverstripe/cms": "~3.2"
|
"silverstripe/cms": "~3.2"
|
||||||
},
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/PHPUnit": "~3.7@stable"
|
||||||
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.1.x-dev"
|
"dev-master": "1.1.x-dev"
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace Subsites\Test\Behaviour;
|
namespace Subsites\Test\Behaviour;
|
||||||
|
|
||||||
|
if(!class_exists('SilverStripe\BehatExtension\Context\SilverStripeContext')) return;
|
||||||
|
|
||||||
use SilverStripe\BehatExtension\Context\SilverStripeContext,
|
use SilverStripe\BehatExtension\Context\SilverStripeContext,
|
||||||
SilverStripe\BehatExtension\Context\BasicContext,
|
SilverStripe\BehatExtension\Context\BasicContext,
|
||||||
SilverStripe\BehatExtension\Context\LoginContext,
|
SilverStripe\BehatExtension\Context\LoginContext,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user