Problem/Motivation
When creating or editing a table using the WYSIWYG editor (CKEditor), column header settings are correctly applied upon saving. However, if rows in the table are merged (using rowspan) while setting column headers, the column header designation is lost when the content is reopened in the editor. Interestingly, merging columns (colspan) with row headers does not cause this issue. This inconsistency forces users to reapply column header settings whenever rows are merged, leading to a poor editing experience.
Steps to reproduce
- Enable a WYSIWYG editor (e.g., CKEditor) for a content type.
- Go to the content creation or editing page.
- Create a table using the editor.
- Merge rows (use
rowspan) and set column headers. - Save the content.
- Reopen the content in the editor and observe that the column header settings are no longer applied.
- Note: This issue does not occur if columns are merged (
colspan) with row headers.
Proposed resolution
Investigate why merging rows while setting column headers causes the header settings to be lost, and implement a fix. Focus areas include:
- CKEditor configuration to ensure that header-related attributes are preserved during the save and reload process, especially when rows are merged.
- Input filter settings to verify that the header attributes are not being stripped out.
Remaining tasks
- Test the issue in a clean Drupal installation to confirm the behavior.
- Determine if the problem is specific to CKEditor or Drupal core.
- Develop and test a fix to ensure column header settings are preserved, even when rows are merged.
- Submit a patch or update documentation as needed.
User interface changes
No visible user interface changes are anticipated. The fix will ensure consistent behavior for table header settings in the editor.
Introduced terminology
No new terminology introduced.
API changes
No API changes expected.
Data model changes
No data model changes expected.
Release notes snippet
Fixed an issue where column header settings in tables were not retained when reopening content in the WYSIWYG editor, particularly when rows were merged.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Screenshot 2025-01-29 134410.png | 45.67 KB | kushagra.goyal |
| screenshot 1.mov | 7.78 MB | kohei_iwamura |
Comments
Comment #2
quietone commentedDrupal 10.3 is only eligible for security fixes. Also, changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies.
Comment #3
kushagra.goyal commentedI have replicated the issue where column header settings are lost when merging rows using rowspan in CKEditor 5, but it doesn't occur when merging columns with colspan. It seems that CKEditor is not correctly preserving the rowspan and colspan attributes when rows are merged. Additionally, input filter settings may be stripping out these attributes during the save process.
To resolve this, we could adjust the CKEditor configuration to ensure the rowspan and colspan attributes are handled properly during both the save and reload processes.
As image attached, in below table Merge cells and then enable column header. After save when try to enable header column for other cell. It also enable previously removed header column.