Closed (duplicate)
Project:
Drupal core
Version:
8.2.x-dev
Component:
render system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Sep 2016 at 06:57 UTC
Updated:
13 Oct 2016 at 12:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wim leersA test to reproduce this would make it much easier to work on this.
Comment #3
amateescu commentedHere's a test :)
Comment #4
wim leersThis reminds me of #2382667: #post_render_callback's that result from other #post_render_calback are not processed btw: recursion in placeholders (that issue I linked is from before placeholders were called placeholders).
#2478483: Introduce placeholders (#lazy_builder) to replace #post_render_cache then updated that test and moved it to
\Drupal\Tests\Core\Render\RendererPlaceholdersTest::testRecursivePlaceholder().That test is obviously passing, so it probably isn't this. Though it feels related.
Comment #6
timmillwoodBlocking #2800737: Add TrashManager::undo to revert to previous revision
Comment #7
dawehnerSo yeah, the problem is that we loose the attachments when rendering the links.
One thing we could do is
FormattableMarkupwith cacheable metadatadrupal_set_message()capable of storing thatComment #8
dawehner@alexpott, @fabianx and @dawehner discussed that and well,
drupal_set_message()supports render arrays, so we can add the required information on there:just for this specific redirect.
Comment #9
berdirThe IMHO easier workaround is to use renderPlain() as I suggested. It works fine, the test was just broken and the user *actually* didn't have access to run cron ;)
I think we should change the placeholder to be more obvious, like 'render-placeholder:' . $hash, so you see what is actually going on.
Note that using Link in a translatable message is wrong anyway, the correct approach is to use run cron. But that won't change anything, the problem is that \Drupal\Core\Render\MetadataBubblingUrlGenerator::generateFromRoute() always passes TRUE. We would need to have a way to call the inner, non-bubbling url generator directly.
I also propose this as a duplicate of #2630920: _csrf_token is broken due to cacheability metadata integration, results in rendered links without valid CSRF tokens. This is exactly the same problem.
Comment #10
timmillwoodDo we want to close this as the patch in #9 being the way to render CSRF links in drupal_set_message?
Do we want to commit the test to make sure it always works?
Do we want to build a better solution?
Comment #11
wim leersComment #12
wim leers