Closed (fixed)
Project:
Drupal core
Version:
8.9.x-dev
Component:
views.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Jun 2020 at 14:17 UTC
Updated:
20 Jul 2020 at 22:09 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
joaomachado commentedComment #3
jddh commentedMe too on 8.9.0. What the heck is this?
Comment #4
honza pobořil commentedThis could be solution.
Comment #5
lendudeLooks like we missed something in #3119279: views-view-table.html.twig template directly uses details without render array and polyfills
Comment #6
lendudeDid a little debugging to figure out why this would be. This happens when
$variables['caption_needed']gets set to true for a different reason then the summary or description.So the fix in #4 makes sense, maybe with a little tweak?
shouldn't we also check $handler->options['summary']
Comment #7
lendudeHere we go. Added a test and updated the fix a bit.
Comment #8
lauriiiThis condition exists in the Twig template before #3119279: views-view-table.html.twig template directly uses details without render array and polyfills and it seems we somehow missed it:
+1 to the change and thank you for adding test coverage for this.
Comment #10
dwwA) Sorry we missed this! Ugh. 🤦♂️
B) Happy to report #7 applies cleanly to 9.1.x branch, too. Should be a simple commit + cherry-pick scenario.
C)
We use both, shouldn't we test that both have a value? Don't we want
&&here?I tested via the Views UI -- looks like if you define a summary title, and leave a blank description, you at least end up with an empty string saved in the options, so there won't be a PHP warning with an undefined array key for description. You just get an empty
<details>. I suppose if someone wanted to have just a summary and no description, we should let them:Also tried saving a description, then going back to clear out the title, and saving the view. You end up with a "raw"
<details>, without the<summary>, but it does work:Convinced myself this is RTBC. ;) +1.
Thanks/sorry,
-Derek
Comment #11
dwwAlso, this bug has nothing (specifically) to do with the grouping setting. Other table settings will trigger it, such as "Caption for the table". Giving this a more generic title for the commit and history.
Thanks,
-Derek
Comment #12
phernand42 commentedPatch in #7 works for me
Comment #13
joaomachado commentedPatch #7 works, everything is as it should be.
Comment #14
joelpittetRan into this today, thanks for patching and adding a test @Lendude! RTBC++
Comment #15
yuanyuan.zhang commentedWhen there's caption the if statement is always true and renders a tag, applied the patch in #7 and it works fine, thanks for the work!
Comment #16
chuchunaku commentedPatch in #7 works for me too.
Comment #17
sl27257Patch #7 is RTBC according to me!
Comment #18
alexpottCan move the
$variables['caption_needed']assignment into the if and reduce complexity and type changes by doing:$variables['caption_needed'] = TRUE;See https://3v4l.org/rIGLZ
Comment #19
ravi.shankar commentedHere I have addressed comment #18.
Comment #20
alexpottCan be
$variables['caption_needed'] = TRUE;now. Then we preserve variable type and have less complexity.Comment #21
ravi.shankar commentedI have addressed comment #20.
Comment #23
alexpott@ravi.shankar there's also some other unexpected change in #21 some path alias stuff.
Comment #24
lendudeHere we go, interdiff is against #7
Comment #25
dww#24 correctly addresses #18. Back to RTBC.
Thanks,
-Derek
Comment #26
alexpottCommitted and pushed 5bd974ae17 to 9.1.x and 16ddcd41a6 to 9.0.x and 582584e499 to 8.9.x. Thanks!