Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
comment.module
Priority:
Critical
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
2 Oct 2015 at 11:51 UTC
Updated:
17 Oct 2015 at 04:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dawehnerWell, could we render a single render array of a node and check the max-age / cache contexts of it?
Comment #3
sasanikolic commentedComment #4
sasanikolic commentedReverted back the create_placeholder. Need some input how to test that.
Comment #5
alexpottWell first up it would be great to see evidence of manual performance testing that this fixing the issue.
Comment #6
wim leersThanks, @sasanikolic!
To test this, you can do something like this, in a kernel test:
Comment #7
wim leersComment #8
wim leersComment #9
sasanikolic commentedI have extended the test, but it fails. Also, together with @berdir, we tried with render and renderRoot. With render, something is changing the max-age from -1 to 0 (appartently in accessCheck), with renderRoot it was false, which makes no sense.
Comment #11
berdirOk, had to get creative a bit with the test, see code and inline comments. Using a nested element for the entity so I can simulate how a real (page) render array that has entities somewhere down in the tree behaves, so I can test both their cache max-age and that of the whole render array.
Also a fix for entity_test_entity_access(), that currently forces a max-age 0 on *every* entity access check, in this case it was the filter access check for the text field.
Comment #12
berdirForgot the test-only patch.
Comment #13
fabianx commentedrenderRoot won't work, because it renders all placeholders including the comment form (per definition).
So you need to use:
Edit: Disregard - I see what you did there now :).
The above works fine, because what berdir did above there is to use a child element and then check the cacheability of the child element, which is enough.
Comment #15
fabianx commentedI believe this typo is the reason for the test fails.
Comment #17
wim leersFixing the typo.
Comment #18
wim leersPatch looks great, just one nitpick to fix:
s/entity types/entities/
Fixed.
Since my only work on the actual code here is a typo fix in #17, the docs typo fix here, and pointing people in the right direction on how to write a regression test, I think it's fine for me to RTBC this.
Comment #19
fabianx commentedRTBC + 1 - if tests pass
(please add me to commit credit if deemed okay)
Comment #20
wim leersClarified IS.
Comment #23
alexpottWe've got tests and fix - this is good to go. Committed 18d4de1 and pushed to 8.0.x. Thanks!