Merge branch '3.7' into 3

This commit is contained in:
Daniel Hensby 2018-07-17 20:53:41 +01:00
commit 01f29bfa5e
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
10 changed files with 41 additions and 9 deletions

View File

@ -16,7 +16,7 @@ HTTP:
no-cache: "true"
no-store: "true"
must-revalidate: "true"
vary: "X-Requested-With, X-Forwarded-Protocol"
vary: "X-Forwarded-Protocol"
LeftAndMain:
dependencies:
versionProvider: %$SilverStripeVersionProvider

View File

@ -918,6 +918,9 @@ class Director implements TemplateGlobalProvider {
* by checking for a custom header set by jQuery or
* wether a manually set request-parameter 'ajax' is present.
*
* Note that if you plan to use this to alter your HTTP response on a cached page,
* you should add X-Requested-With to the Vary header.
*
* @return boolean
*/
public static function is_ajax() {

View File

@ -1232,11 +1232,11 @@ class InstallRequirements {
}
public function hasErrors() {
return sizeof($this->errors);
return empty($this->errors) ? 0 : sizeof($this->errors);
}
public function hasWarnings() {
return sizeof($this->warnings);
return empty($this->warnings) ? 0 : sizeof($this->warnings);
}
}

View File

@ -209,7 +209,7 @@ when calculating a cache key, usually in addition to the full URL path.
By default, SilverStripe will output a `Vary` header with the following content:
```
Vary: X-Requested-With, X-Forwarded-Protocol
Vary: X-Forwarded-Protocol
```
To change the value of the `Vary` header, you can change this value by specifying the header in configuration.
@ -218,3 +218,6 @@ To change the value of the `Vary` header, you can change this value by specifyin
HTTP:
vary: ""
```
Note that if you use `Director::is_ajax()` on cached pages then you should add `X-Requested-With` to the vary
header.

View File

@ -0,0 +1,13 @@
# 3.7.1
<!--- Changes below this line will be automatically regenerated -->
## Change Log
### Bugfixes
* 2018-07-17 [e38c30f](https://github.com/silverstripe/silverstripe-framework/commit/e38c30ff0d9e4ae8ae31a59836fb8e9891f559a5) sizeof doesnt work with null types (Daniel Hensby)
* 2018-06-19 [58bd6c2](https://github.com/silverstripe/silverstripe-framework/commit/58bd6c2248282b9ef6fb940cc6792a7b8c436fbf) Switch to Trusty in Travis (Robbie Averill)
* 2018-06-11 [07112db](https://github.com/silverstripe/silverstripe-cms/commit/07112dbb0bbc4bd624e44586ef3faccdcff1acd1) Remove blind reliance on current versioning stage being valid (Guy)
* 2018-06-11 [02cd32a](https://github.com/silverstripe/silverstripe-framework/commit/02cd32acb3db7b8e3ec5b3617ce6fb5c84fca9d8) Error if invalid stage specified for get_by_stage (Damian Mooyman)
* 2018-06-09 [42e799b](https://github.com/silverstripe/silverstripe-framework/commit/42e799bc43eb83660bc4d35c9c6c5bf7f23989a8) Versioned::choose_site_stage() if no request given (Florian Thoma)

View File

@ -0,0 +1,12 @@
# 3.7.1-rc1
<!--- Changes below this line will be automatically regenerated -->
## Change Log
### Bugfixes
* 2018-06-19 [58bd6c224](https://github.com/silverstripe/silverstripe-framework/commit/58bd6c2248282b9ef6fb940cc6792a7b8c436fbf) Switch to Trusty in Travis (Robbie Averill)
* 2018-06-11 [07112dbb](https://github.com/silverstripe/silverstripe-cms/commit/07112dbb0bbc4bd624e44586ef3faccdcff1acd1) Remove blind reliance on current versioning stage being valid (Guy)
* 2018-06-11 [02cd32acb](https://github.com/silverstripe/silverstripe-framework/commit/02cd32acb3db7b8e3ec5b3617ce6fb5c84fca9d8) Error if invalid stage specified for get_by_stage (Damian Mooyman)
* 2018-06-09 [42e799bc4](https://github.com/silverstripe/silverstripe-framework/commit/42e799bc43eb83660bc4d35c9c6c5bf7f23989a8) Versioned::choose_site_stage() if no request given (Florian Thoma)

View File

@ -1639,6 +1639,8 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
}
if($this->model) $result->setDataModel($this->model);
$this->extend('updateComponents', $result);
return $result
->forForeignID($this->ID)

View File

@ -4,8 +4,8 @@
<% end_if %>
<% loop $FieldList %>
<% if $ColumnCount %>
<div class="column-{$ColumnCount} $FirstLast">
<% if $Top.ColumnCount %>
<div class="column-{$Top.ColumnCount} $FirstLast">
$FieldHolder
</div>
<% else %>

View File

@ -4,8 +4,8 @@
<% end_if %>
<% loop FieldList %>
<% if ColumnCount %>
<div class="column-{$ColumnCount} $FirstLast">
<% if $Top.ColumnCount %>
<div class="column-{$Top.ColumnCount} $FirstLast">
$SmallFieldHolder
</div>
<% else %>

View File

@ -77,7 +77,6 @@ class HTTPTest extends FunctionalTest {
$this->assertNotEmpty($v);
$this->assertContains("X-Forwarded-Protocol", $v);
$this->assertContains("X-Requested-With", $v);
$this->assertNotContains("Cookie", $v);
$this->assertNotContains("User-Agent", $v);
$this->assertNotContains("Accept", $v);