Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
comment.module
Priority:
Critical
Category:
Task
Assigned:
Reporter:
Created:
27 Sep 2013 at 03:35 UTC
Updated:
29 Jul 2014 at 22:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
moshe weitzman commentedUnblocked as comments are now a field.
Comment #2
xjmComment #3
wim leersMore accurate title.
Comment #4
wim leersThis is now blocked on #2118703: Introduce #post_render_cache callback to allow for personalization without breaking the render cache.
Once that is in, this patch solves this issue.
Comment #5
amateescu commentedWhat's with all the drama here?
Comment #6
wim leersWell, 99% of people won't realize the harm that comes with having the comment form on the same page. I figured it might be worthwhile to mention that explicitly.
However, if reviewers don't think that's a good idea, I don't mind removing that :)
Comment #6.0
wim leersUpdated issue summary.
Comment #7
wim leersReroll to track changes in other patch at #2118703-28: Introduce #post_render_cache callback to allow for personalization without breaking the render cache. The code has become much simpler :)
Comment #8
wim leers#2118703: Introduce #post_render_cache callback to allow for personalization without breaking the render cache got committed, which means this issue is now unblocked, yay! :)
Reroll to ensure it applies cleanly, and to s/
comment_insert_form()/comment_replace_form_placeholder/, which better communicates what the#post_render_cachecallback function does.Comment #9
amateescu commentedDon't forget about the "Beware!" stuff. A user facing text like that has no place for being in core :) .. or you might as well change it to "Here be dragons!" or something like that.
Comment #11
wim leers8: comment_form_breaks_render_cache-2099133-8.patch queued for re-testing.
Comment #13
wim leers8: comment_form_breaks_render_cache-2099133-8.patch queued for re-testing.
Comment #14
wim leersComment #15
wim leersThis reroll is identical to the patch in #8, it only removes the "Beware" message amateescu did not like. Could not think of better wording, so it's better to omit it.
(No interdiff because I just removed that hunk from the patch.)
Comment #16
moshe weitzman commentedCode looks great, and the last patch came back green so most recent one should do so as well.
Comment #17
amateescu commentedThanks!
Comment #18
andypost+1 to patch, suppose no reason to have tests for this kind of render cache
Comment #19
wim leers#18: there is *extensive* test coverage in #2118703: Introduce #post_render_cache callback to allow for personalization without breaking the render cache for
#post_render_cache. More importantly: existing integration tests don't need to be modified, so we already have test coverage.Comment #20
msonnabaum commentedYeah, this looks good to me as well.
Comment #21
catchNo complaints here either. Committed/pushed to 8.x, thanks!
Comment #22
wim leersComment #23
yched commentedCould we make comment_replace_form_placeholder() a static method on CommentDefaultFormatter instead ?
Comment #24
wim leers#23: not yet, because
#post_render_cachedoes not yet support object methods, for the reasons outlined at #2118703-42: Introduce #post_render_cache callback to allow for personalization without breaking the render cache. Rest assured that if it becomes possible, I will happily get rid ofcomment_replace_form_placeholder().Comment #25
tstoecklerRe #23/#24:
As call_user_func_array() is used to call the callbacks, I would have thought that static class methods are in fact support by #post_render_cache. Because $callback is used as an array key, what is not supported is array($object, 'method') but I don't see a reason statics like 'Drupal\foo\ClassName::staticMethod' shouldn't be supported. I might be wrong, though.
Comment #26
wim leers#25: you're absolutely right. This is much better.
Thanks, yched & tstoeckler!
Comment #27
tstoecklerAwesome, thanks! Unless the bot objects this is RTBC.
Comment #28
amateescu commentedMissing the leading '\'.
Comment #29
wim leersAddresses #29 and improves a comment.
Comment #30
tstoecklerWe're very inconsistent with this in core currently, so I'm not marking back to "needs work", but on a general note our current coding standard is:
(Not advocating that that standard is a good thing, but it's our curent standard.)
Comment #31
amateescu commentedUps, didn't know about that, sorry. But since we're inconsistent anyway, this can be a novice task to fix all over core.
Comment #32
wim leersHah, so that's exactly what I was thinking: none of our
use Some\Crazy\Namespace\Classstatements also omit a leading backslash.Comment #33
catchThis would've been better in a normal follow-up issue - easier to follow later on. But committed/pushed to 8.x, thanks!
Comment #34
wim leersSorry: I wasn't sure what was preferred. Will do so in the future!
Comment #35
xjmRetroactively tagging beta blocker as a blocker for #2151459: Enable node render caching.
Comment #36
wim leersRetroactively marking critical: a blocker to a critical issue should itself be critical, and this blocked #2151459: Enable node render caching, which is critical.
Comment #37
andypostThis one already fixed, any reason to mark it?