diff --git a/_config/config.yml b/_config/config.yml index 424b8145b..8be36b35d 100644 --- a/_config/config.yml +++ b/_config/config.yml @@ -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 diff --git a/control/Director.php b/control/Director.php index d6ddc97ca..3f62ecc39 100644 --- a/control/Director.php +++ b/control/Director.php @@ -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() { diff --git a/dev/install/install.php5 b/dev/install/install.php5 index 2ae0689f9..2d8b172ce 100755 --- a/dev/install/install.php5 +++ b/dev/install/install.php5 @@ -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); } } diff --git a/docs/en/02_Developer_Guides/08_Performance/02_HTTP_Cache_Headers.md b/docs/en/02_Developer_Guides/08_Performance/02_HTTP_Cache_Headers.md index c47c1fcd6..e4df33def 100644 --- a/docs/en/02_Developer_Guides/08_Performance/02_HTTP_Cache_Headers.md +++ b/docs/en/02_Developer_Guides/08_Performance/02_HTTP_Cache_Headers.md @@ -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. diff --git a/docs/en/04_Changelogs/3.7.1.md b/docs/en/04_Changelogs/3.7.1.md new file mode 100644 index 000000000..77e2572f5 --- /dev/null +++ b/docs/en/04_Changelogs/3.7.1.md @@ -0,0 +1,13 @@ +# 3.7.1 + + + +## 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) diff --git a/docs/en/04_Changelogs/rc/3.7.1-rc1.md b/docs/en/04_Changelogs/rc/3.7.1-rc1.md new file mode 100644 index 000000000..622a305d4 --- /dev/null +++ b/docs/en/04_Changelogs/rc/3.7.1-rc1.md @@ -0,0 +1,12 @@ +# 3.7.1-rc1 + + + +## 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) diff --git a/model/DataObject.php b/model/DataObject.php index cf1adb61e..762aef968 100644 --- a/model/DataObject.php +++ b/model/DataObject.php @@ -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) diff --git a/templates/forms/CompositeField_holder.ss b/templates/forms/CompositeField_holder.ss index d4364c4ee..24f53616c 100644 --- a/templates/forms/CompositeField_holder.ss +++ b/templates/forms/CompositeField_holder.ss @@ -4,8 +4,8 @@ <% end_if %> <% loop $FieldList %> - <% if $ColumnCount %> -
+ <% if $Top.ColumnCount %> +
$FieldHolder
<% else %> diff --git a/templates/forms/CompositeField_holder_small.ss b/templates/forms/CompositeField_holder_small.ss index 3c5436a82..e0fd70427 100644 --- a/templates/forms/CompositeField_holder_small.ss +++ b/templates/forms/CompositeField_holder_small.ss @@ -4,8 +4,8 @@ <% end_if %> <% loop FieldList %> - <% if ColumnCount %> -
+ <% if $Top.ColumnCount %> +
$SmallFieldHolder
<% else %> diff --git a/tests/control/HTTPTest.php b/tests/control/HTTPTest.php index 9beb38f15..9b377cc70 100644 --- a/tests/control/HTTPTest.php +++ b/tests/control/HTTPTest.php @@ -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);