- Issue created by @jannakha
- π¦πΊAustralia jannakha Brisbane!
jannakha β changed the visibility of the branch 3534699-refactor-custom-js to hidden.
- Merge request !37Issue #3534699 by jannakha: Refactor custom JS for CKEditor5 v45+ β (Open) created by jannakha
- π¦πΊAustralia jannakha Brisbane!
this also fixes:
https://www.drupal.org/project/editor_advanced_link/issues/3519379 π Fix keyboard accessibility of advanced attribute fields Active
https://www.drupal.org/project/editor_advanced_link/issues/3534044 π Adding "Open in new window" removes all other attributes Active
https://www.drupal.org/project/editor_advanced_link/issues/3391226 π matcher-pattern-deprecated-attributes-class-key ckeditor warnings Active - π¦πΊAustralia jannakha Brisbane!
@DuaelFr
Hello from Australia! I'm working with @vladimiraus and I did a refactoring of JS files to be more inline with CKEditor5 45+ - would you like to collaborate on it? I'm on slack or here. - π©πͺGermany styx1983
The MR seems to fix all problems we are currently experiencing with the latest release 2.3.1 on Drupal 11.
Especially the "Uncaught CKEditorError: can't access property "_items", t._manualDecoratorSwitches is undefined" that prevented linkit from working properly seems to be fixed within this one.
- π¦πΊAustralia marc.groth
Just to clarify... Issue #3534044 is still an issue. It's a bit confusing because the problem is listed as a known issue under 'Remaining tasks'... But then comment #4 says that the patch fixes it. The former is true. It is still an issue. I also added a comment to the aforementioned ticket
- πΊπΈUnited States tommasorandazzo
Confirming that this fixes my issue with 2.3.1. It also seemed to fix the issue in #3534044 for me. Drupal core 11.2.2
- πΊπΈUnited States jcandan
Confirmed text link attributes all persist as expected with MR !37 on 2.3.x with Drupal 11.2.2.
However, MR !37 breaks image link attributes which, according to #3349389-47: Fix image/media link attributes being lost β , all but
target="_blank"
have been shown working in 2.3.1. - πΊπΈUnited States jcandan
Given π Link attributes don't save Needs review bug affects both 2.2.x and 2.3.x,
And given the effort here to fix 2.3.x specifically for CKEditor 45+
Can we officially adopt the image/media link attributes bug within the scope of this issue?This would allow us to laser focus on the issues as they exist differently in each minor version.
The question is, are we willing to change the scope of each, given the amount of work already attempted?
Give it a day or so, if no comments to the contrary, I may go in and update and clarify scopes for each.
- π¦πΊAustralia jannakha Brisbane!
@jcandan I'll see if have some time next week to check how to handle link attrs on media (it's something to do with their upgrade in v44 and https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-lin...)
- π¦πΊAustralia marc.groth
FWIW: Issue π Adding "Open in new window" removes all other attributes Active is fixed by applying the latest patch in #3535479-18: CKEditor v45: Compatibility with other plugins that modify link attributes β
- π©πͺGermany mrshowerman Munich
Using the patch from MR37 together with Linkit 7.0.8, which added a similar change, I am experiencing some strange behavior.
I have a link like this:
<a href="/node/30" data-entity-type="node" data-entity-uuid="85f7822b-f889-4515-9e20-1addb7ef8e57" data-entity-substitution="canonical">FOOBAR</a>
When I click on it and edit an attribute (e.g. "Open in new window"), the link is temporarily split up into 3 links: one for the part to the left of the cursor, one invisible filler link (containing only 7
⁠
characters), and one for the part to the right of the cursor.<a class="ck-link_selected" href="/node/30" data-entity-type="node" data-entity-uuid="85f7822b-f889-4515-9e20-1addb7ef8e57" data-entity-substitution="canonical" target="_blank">FOO</a> <a class="ck-link_selected" href="/node/30" target="_blank">β β β β β β β </a> <a class="ck-link_selected" href="/node/30" data-entity-type="node" data-entity-uuid="85f7822b-f889-4515-9e20-1addb7ef8e57" data-entity-substitution="canonical" target="_blank">BAR</a>
When the link dialog is closed, the 3 links are replaced with one link again.
<a href="/node/30" data-entity-type="node" data-entity-uuid="85f7822b-f889-4515-9e20-1addb7ef8e57" data-entity-substitution="canonical" target="_blank">FOOBAR</a>
@jannakha, do you have any idea why this happens?
While it normally shouldn't be a problem for most users, it messes up the display for us, because we add an icon to the text through CSS to links that open a new window.
Thus, the text temporarily looks like this:FOO β βBAR β
(should be FOOBAR β, of course) - π¦πΊAustralia jannakha Brisbane!
I can confirm I can reproduce it (see screenshot β ).
@mrshowerman yeah, that's an issue of not going proper version for CKEditor 45+.
Reason for it: CKEditor 44 refactored links api (Drupal is using 45+) which is not compatible with current versions of editor_advanced_link, linkit and other modules as they are now.
linkit 7.0.8 is a bare min refactor to keep attributes of the link, it's not a proper refactor for CKEditor 45+
Fix (not really a fix, but an example of proper refactoring for CKEditor 45+):
- install linkit 7.0.7 and patch https://git.drupalcode.org/project/linkit/-/merge_requests/122.diff (hidden fork on https://www.drupal.org/project/linkit/issues/3535479 π Refactor Linkit plugin for CKEditor5 v45+ Active ) - that works (see screenshot β ).Please re-open (or open a new bug) https://www.drupal.org/project/linkit/issues/3535479 π Refactor Linkit plugin for CKEditor5 v45+ Active and indicate to the maintainer that proper CKEditor 45+ refactoring is required.
- πΊπΈUnited States mark_fullmer Tucson
Please re-open (or open a new bug) https://www.drupal.org/project/linkit/issues/3535479 π Refactor Linkit plugin for CKEditor5 v45+ Active and indicate to the maintainer that proper CKEditor 45+ refactoring is required.
An issue for this has been created in the Linkit issue queue at π Editing Displayed text generates multiple links Active