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.
Problem/Motivation
Without a clearfix class, a progress bar with further elements rendered after it has the later elements run into the progress messages.
Proposed resolution
See #65
Remaining tasks
Created patch
Manual testing
Add screenshots
Review
User interface changes
Correct flow of elements underneath the progress bar.
The issue before the patch:
The issue after the patch:
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#63 | 2781165-63.patch | 2.87 KB | Gauravvvv |
| |||
#43 | clearfix-progressbar-2781165-43.patch | 1.07 KB | oriol_e9g |
#21 | issue-bartik-after.png | 155.66 KB | rachel_norfolk |
#21 | issue-bartik-before.png | 173.9 KB | rachel_norfolk |
#15 | issue-2781165-before.png | 114.3 KB | rose.nichols |
Comments
Comment #2
Mukeysh CreditAttribution: Mukeysh as a volunteer and at gai Technologies Pvt Ltd for gai Technologies Pvt Ltd commentedAdded clearfix class to stable. Attached page for this
Comment #3
joachim CreditAttribution: joachim as a volunteer commentedThat's the right fix, but I'm not sure which copies of the template this should go in. There's:
core/modules/system/templates/progress-bar.html.twig
core/themes/classy/templates/misc/progress-bar.html.twig
core/themes/stable/templates/misc/progress-bar.html.twig
Comment #4
oriol_e9gYou have added the class
cleafix
instead ofclearfix
, see the missing R.We need to add the clearfix to classy and stable, I have reproduced the bug in classy and stable template... so the system template can be used with arbritrary theme and we cannot be sure that the clearfix class exists. I have added the class in core/modules/system/templates because I think that could be a good default class, 99% of themes have a clearfix class from core, and the theme can overwrite the progess template to explicite remove the clearfix class if it's desired.
Comment #5
oriol_e9gComment #6
joachim CreditAttribution: joachim as a volunteer commentedThe clearfix class is implemented in System module, in core/modules/system/css/components/clearfix.module.css, so that means it should probably be applied to the template in system module.
Comment #7
oriol_e9gYes, we need to add the clearfix class in the system template, probably the same bug it's reproducible in bartik and seven.
Comment #8
oriol_e9gCan anyone test it and set the status to RTBC?
Comment #9
rose.nichols CreditAttribution: rose.nichols at Torchbox commentedI am at DrupalCon Dublin and I am going to test this (https://www.drupal.org/contributor-tasks/manual-testing)
Comment #10
autopoietic CreditAttribution: autopoietic at Torchbox commentedAlso at drupalcon, looking at this
Comment #11
thpoul CreditAttribution: thpoul at Pixual commentedComment #12
rose.nichols CreditAttribution: rose.nichols at Torchbox commentedMe and autopoietic have been able to confirm that this is working correctly
Comment #13
rose.nichols CreditAttribution: rose.nichols at Torchbox commentedComment #14
thpoul CreditAttribution: thpoul at Pixual commentedLet's add some before and after screenshots to help the committer!
Comment #15
rose.nichols CreditAttribution: rose.nichols at Torchbox commentedBefore & after screenshots attached
Comment #16
oriol_e9gAll ready! Thanks!
Comment #17
rose.nichols CreditAttribution: rose.nichols at Torchbox commentedBefore
After
Comment #18
rachel_norfolkThanks - that shows the issue (and resolution) much better!
Comment #19
valthebaldBumping to 8.3.x, so that we can have the issue fixed in the future versions as well
Comment #20
valthebaldChanging the status back to 'Needs review' just to see that the issue applies to 8.3.x
Comment #21
rachel_norfolkScreenshots updated with annotations
Comment #22
criscomI am going to review to review the code change in the patch in #5 right now.
I am going to follow the recommendations as posted here: https://www.drupal.org/contributor-tasks/review
Comment #23
valthebaldChanging back to RTBC - path applies to 8.3.x (also tested on simplytest.me), screenshots updated
Comment #24
Eric HeydrichComment #25
joachim CreditAttribution: joachim as a volunteer commentedAll the patch files have been hidden -- which patch is actually being reviewed here?
Comment #26
valthebald@joachim: from #5
Comment #27
valthebaldReordering files to have the patch displayed
Comment #28
criscomWe checked if the patch in #5 applies to all files with class="progress" and/or data-drupal-progress
grep -RF 'class="progress"' core
grep -RF 'data-drupal-progress' core
There are no other files with class="progress" and/or data-drupal-progress.
Patch stays within the scope of this issue.
Not sure about Joachim's comment in https://www.drupal.org/node/2781165#comment-11659703, though. Should we open a new issue for it?
Trying to connect with Joachim but LimeChat crashed.
Comment #29
joachim CreditAttribution: joachim as a volunteer commentedRegarding my comment in #5:
> The clearfix class is implemented in System module, in core/modules/system/css/components/clearfix.module.css, so that means it should probably be applied to the template in system module.
I don't know enough about the theme system and the way in which changes to templates affect backwards compatibility to know what to do about this. It seems to me that either system module's version of this needs to be fixed here, or that system module's version can only be fixed in D9.
Can someone who's at DC maybe find a core theme developer to ask them?
Comment #30
valthebald@criscom: it looks like my comment in #23 overlapped with your one. Didn't mean to cancel your intention to review the summary, sorry for that
Comment #31
thpoul CreditAttribution: thpoul at Pixual commented#29 Quoting mortendk from DrupalCon Dublin
Comment #32
joachim CreditAttribution: joachim as a volunteer commentedThat sounds like the system file should be fixed too...?
Comment #33
thpoul CreditAttribution: thpoul at Pixual commentedFrom https://www.drupal.org/core/d8-bc-policy
Basically that means that changes should not be made in stable and classy. Also before and after screenshots (maybe with markup snippets) need to be done in both seven and bartik and code changes for seven and bartik
and keep this part.
Comment #34
joelpittetThis is a bug fix in classy/stable so different story than the quoted policy in #33. I'm assigning to Cottser to help sort out the policy issues on this. If it's not right in system it should be fixed there too.
Comment #35
joelpittetActually I'm going to make a decision on this, @Cottser is a committer too so he can veto. But due to this being a bugfix it should be in Core, Stable and Classy as it is in #5
Comment #36
joelpittetI'm kind of thinking we remove the fix from Stable and leave the other two while discussing with @lauriii in person since Stable is expected to not have classes(maybe even some utility classes like clearfix? which is the part I'm fuzzy on). Leaving this up to @Cottser for the decision.
Comment #37
joelpittetWhoops meant to leave it RTBC
Comment #38
lauriiiThis issue would yet again benefit of solving this issue #2659890: [Policy] [Plan] Drupal 9 and 10 markup and CSS backwards compatibility since we could do classy fixes in one place and people could copy these fixes from there (or even use directly). Then we wouldn't necessarily have to fix this in Classy.
However, I don't think it is necessary to fix this in core since this is a bug, but it doesn't break any functionality. It just makes things look awkward. Are there other places that look awkward on Classy and Stable? Totally. This is more of a nice improvement for the default stylings than anything else.
Comment #39
star-szrThanks for the work so far, everyone :)
Stable (and core) shouldn't have any visual classes, only functional things, like for example js- prefixed classes. As an example, some people don't want to have a clearfix class and will want to use a CSS-only clearfix applied to different elements. Stable should let them do that.
Along the lines of what @joelpittet was saying in #36, I don't think we should be adding new clearfix classes to Stable or core. So that leaves us with Classy, Seven, and Bartik. In this particular case IMO we should just suck it up and update Bartik and Seven. Leaving Classy, Stable, and core alone and "stable". This fixes the bug for a good chunk of scenarios and is in line with the policies that have already been documented above.
Comment #40
joachim CreditAttribution: joachim as a volunteer commentedFixing only Bartik and Seven means that anyone using this element in their own theme, or a theme that inherits from Classy (which is what your meant to do) will see a broken element. So for example, the screenshots in #17 above of a client site where this element was used would remain broken. How is that a fix?
Comment #41
lauriii@joachim: classy, stable or core doesn't provide any visual design and therefore isn't usable out of box. The designer who is building themes is responsible for making the site work visually.
Comment #42
joelpittetI think agree more with @joachim on here because the CSS that causes the visual bug was written in core (see referenced CSS below) and was not caught during testing.
We could actually fix this entirely in CSS but the CSS would be added to Stable and Classy and core too.
Eg.
Using the
.clearfix
utility class seemed to be the better way to fix the problem and quickly discussed with @mortendk last week and he agreed.Since the problem seems to be an accidental due to removal of this class, I see this as a bugfix as it is categorized.
When Stable and Classy were cut for 8.0.0 release the
float: left/right
were already in place but weren't tested for this use-case with items under.I think system/Core should not be 'fixed' and represent the direction we want to go with this markup and classes. Stable IMO should be fixed due to the location of the bug.
Comment #43
oriol_e9gOk, if I collect all opinions:
Should we fix the bug?
So, new patch acording this...
Comment #44
joachim CreditAttribution: joachim as a volunteer commented> @joachim: classy, stable or core doesn't provide any visual design and therefore isn't usable out of box. The designer who is building themes is responsible for making the site work visually.
This isn't about 'making the site work visually'. Core provides styling for each of its elements, for their internal layout.
The internal layout of this element is broken, because it's crashing into elements that follow it. That's a bug in the styling that core is providing.
Comment #45
rachel_norfolkHmm - I'm a little confused by this. My understanding from way-back-when was that the purpose of Stable was to provide the 'stable' base. So, it allowed us to fix things in core and Classy, while Stable always represented a consistent point in time.
So, Core and Classy see fixes over time but Stable always gives consistent (even if 'wrong') output.
If (!) this is still true then...
We fix in Core and Classy BUT change Stable to reverse any change made in Core so that Stable is, well, stable...
Comment #46
lauriiiClassy is as frozen as is Stable. There's proposal to add unstable Classy to core to allow this kind of changes to be included #2659890: [Policy] [Plan] Drupal 9 and 10 markup and CSS backwards compatibility
Comment #47
jp.stacey CreditAttribution: jp.stacey at Magnetic Phield commentedIt would be useful to be able to point to policy documents not just on the frozenness or otherwise of core, Classy, Stable, Seven, Bartik etc: but also, what does frozen mean? When we used to freeze Drupal core for a major release, didn't we still permit bugfixes; wasn't that, in fact, the whole point? (Note that the policy page linked to doesn't even use the word "frozen", so maybe we shouldn't even use it.)
If this counts as a bugfix (and I think it's telling that, as far as I can see, nobody has changed this issue's category from "Bug report" since it was created) and if "frozen" only means "frozen to new features", then this bugfix should go in *everywhere* that's affected, and exactly where it gets changed becomes a matter of what code inherits from what, to make the change the simplest.
Comment #60
quietone CreditAttribution: quietone at PreviousNext commentedThis issue was discussed in #bugsmash, with smustgrave, darvanen,and mstrelan. It was decided that this belongs in the contrib project. And that decision received support by larowlan and Tinto.
Comment #61
joachim CreditAttribution: joachim as a volunteer commentedIt's a core bug - it belongs in whatever has replaced the Stable theme in core.
Comment #62
joachim CreditAttribution: joachim as a volunteer commentedProblem still exists in 10.1's Stable9 and Classy themes.
Comment #63
Gauravvvv CreditAttribution: Gauravvvv at Axelerant for Drupal India Association commentedThe Problem still exists in following themes:
demo_umami, claro, stable9, starterkit_theme
I have provided a patch for same, Please review
Comment #64
Gauravvvv CreditAttribution: Gauravvvv at Axelerant for Drupal India Association commentedComment #65
larowlanIn 2023, clearfix is not the answer, regardless of the question.
I think we can fix this by moving to modern CSS, instead of using float left and right, we can make .progress display: flex and position the percentage and description using flexbox, this fix would go in system module's progress.module.css
After that, Claro's ::after attribute to add clearfix (without the clearfix class) can probably be removed too.
Umami, classy etc will all likely be fixed by changing from float to flexbox and that means we don't need any fixes in templates, which means we have no BC issues.
Comment #66
larowlanComment #67
quietone CreditAttribution: quietone at PreviousNext commented@larowlan, thanks for chiming in.
I have updated the remaining tasks and the proposed resolution has a link to comment #65.
Comment #68
joachim CreditAttribution: joachim as a volunteer commentedThanks @larowlan. I've updated the title to describe the problem rather than the (now outdated) solution.