Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When working on #2645740: Replace tree_table with a render element and simplify other theme functions, I realized that it is useful to check if restricted tokens are shown on the help page (which was a bug I only caught manually).
Comment | File | Size | Author |
---|---|---|---|
#13 | add_tests_to_check_for-2646952-12.patch | 4.67 KB | hussainweb |
|
Comments
Comment #2
hussainwebHere is something to get started.
Comment #3
hussainwebI suppose we should also check that restricted tokens are not shown on other trees. This patch should help.
Comment #5
hussainwebI think this should fix it.
Comment #7
hussainwebI have commented out the test that fails with a todo as the issue is something else entirely. I have not removed it because it could be quite useful once we fix the issue with caching. Here is the comment for quick reference:
Comment #8
BerdirAh. That's not token caching, that's the dynamic page caching.
This should be easy enough to fix, we just need to instruct it that url arguments are relevant for the output of the page. See https://www.drupal.org/developing/api/8/cache/contexts.
Add '#cache' => ['contexts' => ['url.query_args']] to the render array returned by that controller and it should work.
Comment #10
hussainwebYes, already done here: #2647012: Add cache context for the token/tree page. I thought of keeping it separate but if you want, it can be in one patch as well.
Comment #11
BerdirAh, cros post. Yes, lets just do that together in this issue.
Comment #13
hussainwebSure, here it is.
Comment #14
hussainwebComment #16
BerdirThanks, committed.