Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
theme system
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
10 Mar 2013 at 23:30 UTC
Updated:
29 Jul 2014 at 22:01 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
chrisjlee commentedTrying to get things rolling. Not sure what to do with converting render elements. Anyone have any ideas?
Comment #2
chrisjlee commentedComment #3
star-szrThe only thing confusing me is the check for
if dropbutton_wrapper is defined.The render element should be fine, the Twig engine will handle rendering it. Looks like a good start, sending for review. Thanks @chrisjlee!
Comment #5
chrisjlee commented@Cottser I don't need to check if dropbutton_wrapper is defined do it?
Comment #6
star-szrI don't see where dropbutton_wrapper would be defined, since it's not in the preprocess function. I haven't tested the patch but I think if you remove those lines we might see different test results.
Thanks again!
Comment #7
chrisjlee commented@cottser Thanks! I didn't know that. I'll give that a try.
Comment #8
chrisjlee commentedinterdiff for #7
Comment #9
chrisjlee commentedComment #11
chrisjlee commented#7: 1939086-7.patch queued for re-testing.
Comment #13
chrisjlee commentedreroll patch. i hope i do this correctly.
Comment #14
hefox commentedComment #16
joelpittetDid some doc cleanup, changed the filename to use hyphen's instead of underscores and did some whitespace cleanup. And made the twig docblock a real docblock. Tests seem to pass locally... so we'll see.
Nice work getting this started @chrisjlee! If you see anything else that could be fixed, feel free to reroll.
Comment #18
joelpittetsame, wrong site tested... this should be better.
Comment #19
star-szrLiterally the only thing I could find wrong with this:
s/Preprocess/Prepares.
Other than that, RTBC :)
Comment #20
star-szrOh, and this needs a period at the end. So two things :) Thanks guys!
Comment #21
star-szrThis could use manual testing as well.
Comment #22
chrisjlee commentedSmall tweaks as requested in 19/20.
Comment #23
chrisjlee commentedForgot to hit save while editing theme.inc the second time.
Please ignore #22.
Comment #24
star-szrThanks a bunch @chrisjlee! I missed these two before:
Prepares variables for dropbutton wrapper templates. (remove 'a', and plural templates at the end, missed this before).
template_preprocess_dropbutton_wrapper() - dropbutton instead of dropdownbutton.
Comment #25
chrisjlee commented@Cottser Thanks for the feedback!
Comment #26
star-szrMarkup matches exactly, two tiny tweaks and then this is ready to go.
I think this should say "for a dropbutton wrapper."
The contents of the {% spaceless %} tag should be indented per Twig coding standards.
Comment #27
star-szrThe above would be a great Novice task.
Comment #28
chrisjlee commentedSorry i read this issue then forgot to get back to it. I'll finish this one off.
Comment #29
chrisjlee commentedComment #30
chrisjlee commentedUpdated as per discussion and review with Cottser over IRC
Comment #31
chrisjlee commentedInterdiff for #30
Comment #32
chrisjlee commentedarg forgot to interdiff.
Comment #33
chrisjlee commentedFixed Children indentation back again.
Comment #34
star-szrThanks @chrisjlee! RTBC once it comes back green.
Manual testing looks good, code and documentation look good, this is ready :)
Comment #35
tim.plunkettThere's no generic way to do this? Or something to change in hook_theme()? It just seems very non-specific and wasteful.
Comment #36
tim.plunkettHow about this?
Comment #37
steveoliver commentedNice. Just one quick thing.
Since {% spaceless %} has no effect on the contents of tags, in this case the {% if children %} check, the spaceless tag should be inside the children tag.
Comment #38
chrisjlee commentedChanges applied as per #37.
Comment #39
star-szrThanks everyone, especially @tim.plunkett, that's much better.
Comment #40
alexpottComment #41
thedavidmeister commentedComment #42
jenlamptonThink this was meant to be needs review (&profiling), not needs work (&profiling)?
Comment #43
fabianx commented#36: Very nice change!
Comment #44
star-szrWorking on profiling this one.
Comment #45
star-szrNumbers don't look so great for this one, performance will need some work.
Scenario: A simplified version of admin/content, displaying 50 dropbutton wrappers.
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=51ff119b87ac8&...
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=51ff119b87ac8&...
Comment #46
fabianx commentedYeah, that is the usual theme function vs. twig templates performance difference. (Thats around 0.1 ms per call) (can be seen better here: http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?symbol=theme%404&ru...)
Do we anticipate this being used on non-admin pages?
If not, this can straight go in as 5ms on a 460ms page is not much (and admin only).
Setting back to RTBC and leaving decision for alexpott.
Comment #47
webchickHm. Assigning to catch to give an opinion on those #s. I don't think dropbutton is used by core outside of admin pages, but contrib can always do weird stuff.
Comment #48
catchHmm this is really an admin-facing theme function, if contrib uses it for visitor-facing stuff they would indeed be doing something quite weird. Given that I think the regression is OK - there's other stuff on admin/content we could likely optimize if we had a proper look at it.
Committed/pushed to 8.x.
Comment #49.0
(not verified) commentedUpdate remaining, add testing steps