Comments

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new456 bytes
fabianx’s picture

Status: Needs review » Needs work

I think we miss some test coverage here, but yes straight follow-up.

The last submitted patch, 1: 2453891-1.patch, failed testing.

Dragooon’s picture

Status: Needs work » Needs review
StatusFileSize
new3.56 KB
new4.05 KB

Updated tests for the patch

The last submitted patch, 4: 2453891-1-tests.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: 2453891-1.patch, failed testing.

Dragooon’s picture

StatusFileSize
new6.33 KB
new6.82 KB

Missed a few cases in past patch

fabianx’s picture

Status: Needs work » Needs review
cosmicdreams’s picture

+++ b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
@@ -114,6 +114,7 @@ public function providerTestContextBubblingEdgeCases() {
+          'max-age' => -1,

@@ -142,6 +143,7 @@ public function providerTestContextBubblingEdgeCases() {
+          'max-age' => -1,

@@ -165,6 +167,7 @@ public function providerTestContextBubblingEdgeCases() {
+          'max-age' => -1,

@@ -251,6 +256,7 @@ public function providerTestContextBubblingEdgeCases() {
+          'max-age' => -1,

@@ -339,6 +345,7 @@ public function testConditionalCacheContextBubblingSelfHealing() {
+        'max-age' => -1,

@@ -362,6 +369,7 @@ public function testConditionalCacheContextBubblingSelfHealing() {
+        'max-age' => -1,

@@ -393,6 +401,7 @@ public function testConditionalCacheContextBubblingSelfHealing() {
+        'max-age' => -1,

@@ -417,6 +426,7 @@ public function testConditionalCacheContextBubblingSelfHealing() {
+        'max-age' => -1,

@@ -432,6 +442,7 @@ public function testConditionalCacheContextBubblingSelfHealing() {
+        'max-age' => -1,

@@ -447,6 +458,7 @@ public function testConditionalCacheContextBubblingSelfHealing() {
+        'max-age' => -1,

+++ b/core/tests/Drupal/Tests/Core/Render/RendererPostRenderCacheTest.php
@@ -92,6 +92,7 @@ public function testPostRenderCacheWithColdCache() {
+        'max-age' => -1,

@@ -228,6 +229,7 @@ public function testRenderChildrenPostRenderCacheDifferentContexts() {
+        'max-age' => -1,

@@ -323,6 +325,7 @@ public function testRenderChildrenPostRenderCacheComplex() {
+        'max-age' => -1,

@@ -349,6 +352,7 @@ public function testRenderChildrenPostRenderCacheComplex() {
+        'max-age' => -1,

@@ -463,6 +467,7 @@ public function testPlaceholder() {
+        'max-age' => -1,

@@ -561,6 +566,7 @@ public function testChildElementPlaceholder() {
+        'max-age' => -1,

@@ -589,6 +595,7 @@ public function testChildElementPlaceholder() {
+        'max-age' => -1,

@@ -620,6 +627,7 @@ public function testChildElementPlaceholder() {
+        'max-age' => -1,

Should these be 0 instead of -1? In the #2443073: Add #cache[max-age] to disable caching and bubble the max-age issue I saw that setting these to 0 was effectively saying don't cache them.

The last submitted patch, 7: 2453891-1-tests.patch, failed testing.

fabianx’s picture

That should be Cache::PERMANENT instead, which is == -1;

Dragooon’s picture

So, replace -1 with Cache::PERMANENT instead?

wim leers’s picture

Status: Needs review » Needs work

#11++

#9: the default value is Cache::PERMANENT — we assume permanent cacheability; it's up to the code building the render array to specify a non-permanent max-age and the associated cache tags to ensure it's invalidated when appropriate.

wim leers’s picture

#12: yes! And thank you very much for taking this one on :)

Dragooon’s picture

StatusFileSize
new6.97 KB
new7.46 KB

#14; Okay, understood. It sets the value of max-age to Cache::PERMANENT by default instead of hardcoded -1, should've checked that before. Thanks!

Dragooon’s picture

Status: Needs work » Needs review

The last submitted patch, 15: 2453891-1-tests.patch, failed testing.

fabianx’s picture

Status: Needs review » Reviewed & tested by the community

Nice work, RTBC.

This is just a straight bug fix that was overseen from a previous issue.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed cc54a48 and pushed to 8.0.x. Thanks!

  • alexpott committed cc54a48 on 8.0.x
    Issue #2453891 by Dragooon, Wim Leers: Renderer::getCacheableRenderArray...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.