Merge branch '3.4' into 3

This commit is contained in:
Daniel Hensby 2016-11-03 13:27:31 +00:00
commit 0a835c6fe7
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
5 changed files with 26 additions and 76 deletions

View File

@ -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

View File

@ -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'
<div class="notice" markdown="1">
Additional selectors implicitely change the scope so you need to put additional `$Up` to get what you expect.
</div>
:::ss
<h1>Children of '$Title'</h1>
<% loop $Children.Sort('Title').First %>
<%-- We have two additional selectors in the loop expression so... --%>
<p>Page '$Title' is a child of '$Up.Up.Up.Title'</p>
<% 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

View File

@ -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
<h1>Children of '$Title'</h1>
<% loop $Children %>
<p>Page '$Title' is a child of '$Up.Title'</p>
<% loop $Children %>
<p>Page '$Title' is a grandchild of '$Up.Up.Title'</p>
<% 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'
<div class="notice" markdown="1">
Additional selectors implicitely change the scope so you need to put additional `$Up` to get what you expect.
</div>
:::ss
<h1>Children of '$Title'</h1>
<% loop $Children.Sort('Title').First %>
<%-- We have two additional selectors in the loop expression so... --%>
<p>Page '$Title' is a child of '$Up.Up.Up.Title'</p>
<% 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
<h1>Children of '$Title'</h1>
<% loop $Children %>
<p>Page '$Title' is a child of '$Top.Title'</p>
<% loop $Children %>
<p>Page '$Title' is a grandchild of '$Top.Title'</p>
<% end_loop %>
<% end_loop %>
See [scope](syntax#scope).
## Breadcrumbs

View File

@ -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) {

View File

@ -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) {