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
Filing this under Claro because it's an uncaught Claro-only bug. But really it's more of a filter.module
bug. I'll let others pick the best component.
Steps to reproduce
- Drag in a new CKEditor toolbar button such as the one for
<s>
:
- On Seven, this happens:
✅ - On Claro, this happens:
❌
Root cause analysis:
- Seven
- Claro
Root cause: Claro changes class
attribute values in the admin UI, specifically that of form item descriptions.
OTOH, this was probably only an implicit API?
Proposed resolution
Harden the selector in core/modules/filter/filter.filter_html.admin.es6.js
.
Remaining tasks
Create patch- Review patch
- Test patch
- Commit
User interface changes
On Claro, you will now see this:
API changes
None.
Data model changes
None.
Release notes snippet
N/A
Comment | File | Size | Author |
---|---|---|---|
#12 | after_patch6.png | 103.89 KB | sonam.chaturvedi |
#12 | before patch6.png | 96.87 KB | sonam.chaturvedi |
#6 | reroll_diff_3-6.txt | 2.54 KB | awset |
#6 | 3216214-6.patch | 1.62 KB | awset |
#3 | interdiff-3216214-2_3.txt | 783 bytes | Gauravvvv |
Comments
Comment #2
Wim LeersIdeal/correct solution is impossible without drastic API changes?
I'd say that the best solution here would be to add a class to target. A
js-SOMETHING
class. That is AFAICT the best practice.Unfortunately,
template_preprocess_form_element()
does not allow us to do that:We have no way to add things to
$description_attributes
😔So pragmatic solution it is?
Which means AFAICT the only way to fix this is to target the
id
attribute instead.So … doing that in this patch. Result:
Comment #3
Gauravvvv CreditAttribution: Gauravvvv at OpenSense Labs commentedFixed custom command failed. Attached interdiff for same.
Comment #4
Wim LeersThanks, @Gauravmahlawat!
Comment #6
awset CreditAttribution: awset at Salsa Digital commentedThe patch #3 by @Gauravmahlawat is working in 9.3 brach, but it can't be applied to 9.4 branch.
I re-rolled the patch from #3 to 9.4 branch.
It needs manual review.
Comment #7
Gauravvvv CreditAttribution: Gauravvvv at Srijan | A Material+ Company for Drupal India Association commentedComment #9
Kristen PolUnrelated error. Back to needs review.
Comment #10
Kristen PolConfirmed that patch in #6 applies cleanly to 9.3 and 9.4 and with offsets for 10. Updated issue summary with tasks.
Comment #12
sonam.chaturvedi CreditAttribution: sonam.chaturvedi at Salsa Digital commentedVerified and tested successfully.
Patch applied cleanly with two offsets on 9.5.x-dev.
Test Steps:
1. Goto Configuration > Content authoring > Text formats and editors
2. Edit CKEditor and drag in a new CKEditor toolbar button such as the one for
3. Verify "Based on the text editor configuration, these tags have automatically been added:
." is displayed under filter settings.Test Result:
"Based on the text editor configuration, these tags have automatically been added:
." is displayed under filter settings.Before patch:
After patch:
RTBC +1
Comment #13
ameymudras CreditAttribution: ameymudras at Salsa Digital commentedVerified the patch #6 on 9.5.x and following are my observations:
1. The patch applies cleanly
2. The issue summary is clear
3. Was able to reproduce the issue with "steps to reproduce" & the patch fixes the issue
Based on #12 moving this to RTBC
Comment #14
Kristen PolThanks for the testing and review!
Removing testing tag.
Comment #19
lauriiiCommitted and pushed to 10.1.x and cherry-picked to 10.0.x, 9.5.x, and 9.4.x. Thank you!