diff --git a/.travis.yml b/.travis.yml index f0226c4c9..350136846 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ addons: env: global: - - CORE_RELEASE=3 - "ARTIFACTS_AWS_REGION=us-east-1" - "ARTIFACTS_S3_BUCKET=silverstripe-travis-artifacts" - secure: "DjwZKhY/c0wXppGmd8oEMiTV0ayfOXiCmi9Lg1aXoSXNnj+sjLmhYwhUWjehjR6IX0MRtzJG6v7V5Y+4nSGe+i+XIrBQnhPQ95Jrkm1gKofX2mznWTl9npQElNS1DXi58NLPbiB3qxHWGFBRAWmRQrsAouyZabkPnChnSa9ldOg=" @@ -33,6 +32,7 @@ matrix: env: DB=MYSQL BEHAT_TEST=1 CMS_TEST=1 before_script: + - export CORE_RELEASE=$TRAVIS_BRANCH - if ! [ $(phpenv version-name) = "5.3" ]; then printf "\n" | pecl install imagick; fi - if [ $(phpenv version-name) = "5.3" ]; then printf "\n" | pecl install imagick-3.3.0; fi - composer self-update || true diff --git a/docs/en/02_Developer_Guides/01_Templates/01_Syntax.md b/docs/en/02_Developer_Guides/01_Templates/01_Syntax.md index 5806195be..11b01de0b 100644 --- a/docs/en/02_Developer_Guides/01_Templates/01_Syntax.md +++ b/docs/en/02_Developer_Guides/01_Templates/01_Syntax.md @@ -412,7 +412,7 @@ When in a particular scope, `$Up` takes the scope back to the previous level. <% end_loop %> Given the following structure, it will output the text. - + My Page | +-+ Child 1 @@ -427,6 +427,16 @@ Given the following structure, it will output the text. Page 'Grandchild 1' is a grandchild of 'My Page' Page 'Child 2' is a child of 'MyPage' +
+Additional selectors implicitely change the scope so you need to put additional `$Up` to get what you expect. +
+ + :::ss +

Children of '$Title'

+ <% loop $Children.Sort('Title').First %> + <%-- We have two additional selectors in the loop expression so... --%> +

Page '$Title' is a child of '$Up.Up.Up.Title'

+ <% end_loop %> #### Top @@ -444,8 +454,6 @@ page. The previous example could be rewritten to use the following syntax. <% end_loop %> <% end_loop %> - - ### With The `<% with %>` tag lets you change into a new scope. Consider the following example: @@ -466,7 +474,12 @@ Outside the `<% with %>.`, we are in the page scope. Inside it, we are in the sc refer directly to properties and methods of the [api:Member] object. `$FirstName` inside the scope is equivalent to `$CurrentMember.FirstName`. +### Me +`$Me` outputs the current object in scope. This will call the `forTemplate` of the object. + + :::ss + $Me ## Comments diff --git a/docs/en/02_Developer_Guides/01_Templates/02_Common_Variables.md b/docs/en/02_Developer_Guides/01_Templates/02_Common_Variables.md index 521d6ae5d..dc99fe2fc 100644 --- a/docs/en/02_Developer_Guides/01_Templates/02_Common_Variables.md +++ b/docs/en/02_Developer_Guides/01_Templates/02_Common_Variables.md @@ -304,72 +304,7 @@ For example, imagine you're on the "bob marley" page, which is three levels in: ## Navigating Scope -### Me - -`$Me` outputs the current object in scope. This will call the `forTemplate` of the object. - - :::ss - $Me - - -### Up - -When in a particular scope, `$Up` takes the scope back to the previous level. - - :::ss -

Children of '$Title'

- - <% loop $Children %> -

Page '$Title' is a child of '$Up.Title'

- - <% loop $Children %> -

Page '$Title' is a grandchild of '$Up.Up.Title'

- <% end_loop %> - <% end_loop %> - -Given the following structure, it will output the text. - - My Page - | - +-+ Child 1 - | | - | +- Grandchild 1 - | - +-+ Child 2 - - Children of 'My Page' - - Page 'Child 1' is a child of 'My Page' - Page 'Grandchild 1' is a grandchild of 'My Page' - Page 'Child 2' is a child of 'MyPage' - -
-Additional selectors implicitely change the scope so you need to put additional `$Up` to get what you expect. -
- - :::ss -

Children of '$Title'

- <% loop $Children.Sort('Title').First %> - <%-- We have two additional selectors in the loop expression so... --%> -

Page '$Title' is a child of '$Up.Up.Up.Title'

- <% end_loop %> - -### Top - -While `$Up` provides us a way to go up one level of scope, `$Top` is a shortcut to jump to the top most scope of the -page. The previous example could be rewritten to use the following syntax. - - :::ss -

Children of '$Title'

- - <% loop $Children %> -

Page '$Title' is a child of '$Top.Title'

- - <% loop $Children %> -

Page '$Title' is a grandchild of '$Top.Title'

- <% end_loop %> - <% end_loop %> - +See [scope](syntax#scope). ## Breadcrumbs diff --git a/model/DataList.php b/model/DataList.php index d50f20e13..305be0fbb 100644 --- a/model/DataList.php +++ b/model/DataList.php @@ -434,7 +434,7 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab } elseif($numberFuncArgs == 2) { $whereArguments[func_get_arg(0)] = func_get_arg(1); } else { - throw new InvalidArgumentException('Incorrect number of arguments passed to exclude()'); + throw new InvalidArgumentException('Incorrect number of arguments passed to filterAny()'); } return $this->alterDataQuery(function($query, $list) use ($whereArguments) { diff --git a/model/ValidationResult.php b/model/ValidationResult.php index 75cdee244..b014d4b20 100644 --- a/model/ValidationResult.php +++ b/model/ValidationResult.php @@ -8,19 +8,21 @@ */ class ValidationResult extends Object { /** - * Boolean - is the result valid or not + * @var bool - is the result valid or not */ protected $isValid; /** - * Array of errors + * @var array of errors */ protected $errorList = array(); /** * Create a new ValidationResult. * By default, it is a successful result. Call $this->error() to record errors. + * @param bool $valid + * @param string|null $message */ public function __construct($valid = true, $message = null) { $this->isValid = $valid; @@ -30,8 +32,8 @@ class ValidationResult extends Object { /** * Record an error against this validation result, - * @param $message The validation error message - * @param $code An optional error code string, that can be accessed with {@link $this->codeList()}. + * @param string $message The validation error message + * @param string $code An optional error code string, that can be accessed with {@link $this->codeList()}. * @return ValidationResult this */ public function error($message, $code = null) { @@ -99,7 +101,7 @@ class ValidationResult extends Object { * It will be valid if both this and the other result are valid. * This object will be modified to contain the new validation information. * - * @param ValidationResult the validation result object to combine + * @param ValidationResult $other the validation result object to combine * @return ValidationResult this */ public function combineAnd(ValidationResult $other) {