Closed (fixed)
Project:
CAPTCHA
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Jun 2023 at 14:17 UTC
Updated:
10 Aug 2023 at 15:09 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #3
grevil commentedDone, please review! See screenshot:

Comment #4
anybodyWe made that change intentionally, as
label's have Drupal default styling, while fieldsetlegend's don't.See the issue over here: #3357694: Use label & description for captcha label & description instead of custom structure I'm not very motivated to reverse that decision.
But another point was also raised:
@thomas.frobieter mentioned that for the fieldset styling should have further classes for core themes, eventually.
Also, changing the markup might break existing installations (BC), so we have to double-check if this is still allowed in beta.
Assigning @thomas.frobieter to add possible Drupal Core default classes (that won't break things?).
Once 2.0.0 is released, we'll definitely not be allowed to make such changes anymore for a widely used module like this:
https://www.drupal.org/about/core/policies/core-change-policies/allowed-...
Comment #5
anybodyComment #6
anybodyComment #7
anybodyA good reason for using the
legendwould be, that some of the captcha implementations use their own label for the captcha input. Others don't.While our label will never technically collide with them, using
legendwould 100% separate them in all cases.I think best will be to compare the outcome in major Drupal themes, and afterwards @thomas.frobieter should have the last word on that. These should be our final (justified breaking) changes to the twig file anyway until 3.x!
Comment #8
grevil commentedSetting this to major, as it prevents the 2.x release and enables the module for #3365265: Release 2.0.0 to safe folks from wrong versions to apply.
Comment #9
thomas.frobieterSo, the idea is:
- Use the regular fieldset renderer, so the fieldset.html.twig will be used
- Use the captcha.html.twig only for the fieldset contents
Both are overridable by themes, while getting the default fieldset styles from the (base) theme. So we don't get a ugly unstyled fieldset, like we currently do in for example Claro and Olivero.
This way, the decision to use legend or label ist not up to us, its up the the (base) theme and thats fine.
Comment #10
anybodyRe #9 ok so let's test this here in the MR, see what the results and pro / con's are and if it takes too much time / isn't worth it. Based on that, we should then decide, how to proceed further. From simple to complex.
Nice ideas for improvement @thomas.frobieter. Anyway, I think we shouldn't invest days and set a justified limit.
If it doesn't work well or is too complex, we can still discuss to switch back to
legend- then we definitely need to compare the results in relevant themes.Comment #11
thomas.frobieterI agree, so @Grevil can you please figure out if we are able to use the regular fieldsets, etc. like described in #9? I'll help with the templates, classes etc. if required.
Comment #12
anybodyOne more point: We need to ensure that we have our own theme suggestion just for this fieldset render!
As we don't want to add one for any fieldset, we need to pass it in the render array itself. This seems possible, see: https://www.drupaladventures.com/article/theme-suggestions-theme-render-...
Comment #13
anybodyOkay... I just wanted to give this a first shot, went into the code and then saw @Grevil's and my pain around all these bloated, decade old structures... especially the several modifications to the array structures plus CAPTCHA implementations relying on these structures. We shouldn't touch it.
Honestly, I don't think the proposed change to fieldsets is possible within hours, not even a day. And it's very risky, as then the fieldset will influence the captcha's array structure technically (the old tree thing...).
I wanted to try, because I see the benefits from what @thomas.frobieter said, but this should be done with or after CAPTCHA rewrite from scratch. This is far above our heads and budgets.
@thomas.frobieter may still decide to make the switch back to legend instead of label, I won't block that, if there are good enough reasons and if it's before 2.0.0.
Someone always has to pay...
Comment #14
thomas.frobieterFlip a coin, I don't think its really relevant. Label is better to style, Legend is semantically correct.
Some sites already use the beta release, so they have might already styled it as label. So, lets stick with this.
Comment #15
grevil commentedOk, I guess we can set this postponed to whenever and do a real release?
Comment #16
grevil commentedComment #17
anybodyComment #18
neclimdulNot sure what would be postponing work on this so unblocking.
Relevant WCAG rule this would fix. https://www.w3.org/WAI/WCAG21/Techniques/html/H71
Comment #19
anybodyGood point @neclimdul!
https://www.w3.org/WAI/WCAG21/Techniques/html/H71
So let's fix the tests and do this. Who's willing?
Comment #20
anybody@neclimdul what do you think about this proposed change? That would also comply with the default and solve issues with #3377448: Google Tag manager is loaded without consent, if no title is used.
Comment #21
anybody@neclimdul what do you think about this proposed change? That would also comply with the default and solve issues with #3377448: Google Tag manager is loaded without consent, if no title is used.
Comment #22
anybodyComment #23
anybodyRe-introduced backwards-compatibility for the structure, if no title is set and if a title is set, improved the markup.
This was planned to be 2.x only, but with #3367503: Difficult migration from Drupal 9 to 10 got into 8.x-1.* which is out of scope here.
Comment #24
grevil commentedNice, tests are all green! RTBC!
Comment #25
anybodyThanks @Grevil, let's merge this into 2.x and keep it there for some days. Also fixing #3375511: 8.x-1.12 shows captcha fieldset, even without captcha output by bringing back the old structure, if no title is given.