Closed (fixed)
Project:
Drupal core
Version:
9.3.x-dev
Component:
ckeditor5.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Mar 2022 at 13:11 UTC
Updated:
26 Apr 2022 at 17:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
lauriiiComment #3
lauriiiThis seems to be something we could fix on our side.
Comment #4
lauriiiOopsie, glad to see DrupalCI is doing what it's supposed to, and checks that CKEditor was built correctly! 👏
Comment #5
lauriiiComment #6
lauriiiComment #8
wim leers🤔 There is no longer any mention of
alignBlock*model attribute values … how is that possible?+1 — this makes sense! This avoids data loss.
🤓 Nit: I think that the name is a bit off. It's not just conversion. It's ensuring that
data-alignanddata-captionare not lost, not even for inline images.👍 Ran locally with and without the JS changes.
Failed without the JS changes.
Passed with the JS changes.
only for the third point.
Comment #9
wim leersComment #10
lauriii#8.1: We don't have buttons for the image styles that force conversion to block images so I don't think we should be using them in the upcast either. That points out that the logic I applied here might be still incorrect since
data-aligncould be applied to inline image 🤔 I think we need to test that specific scenario and make a slight change to the logic.#8.3 Do you have recommendation on what a better name for the test could be?
Comment #11
lauriiiHere's a patch that should address #10.1.
This also adds additional test coverage which extends the test beyond the attributes.
Comment #12
wim leersÜbernit: "editor" here could be misinterpreted as the text editor, not the person doing the editing. "content creator" would clarify that.
Nit: No-op change, let's revert this.
🤔 AFAICT
$modehere really means "expected upcasting by CKEditor 5 if the starting point is an inline image".So I think that
$expected_upcast_behavior_when_wrapped_in_block_elementwould be a better name?(This took by FAR the longest amount of time to figure out!)
testDynamicUpcastBehavior()ortestInlineVsBlockImageUpcasting()ortestAttributeRetentionDuringUpcasting()?Comment #13
ravi.shankar commentedHere I have tried to address the points of comment #12, please review.
Comment #15
lauriiiThank you @ravi.shankar!
#12.4 The test is also ensuring correct behavior for downcast
Comment #16
wim leers#15 But this only adding a fix for upcasting, in
viewImageToModelImage()? If you can think of a better name, that'd be awesome, but I do think this is a net improvement. While imperfect, it better conveys why we have this test coverage at least? 😊 So … feel free to rename again and keep the "RTBC" status, but that really was my only remaining point of confusion.Given that you have not raised concerns about the change I proposed in #12.3 nor in @ravi.shankar's implementation of it, I think that means you're +1 to that too.
So: RTBC! :)
Comment #17
bnjmnmAdding "Needs issue summary update", the solution should be summarized at least briefly.
Comment #18
bnjmnmBasically doc & naming nits. Also note the "Needs issue summary update" from 👆. The caption part can probably be lifted directly from the comments in
drupalimageediting, and the align solution could use a sentence or two about how it's effectively Block/Inline agnostic now.What about s/$test_attributes/$attributes_to_retain
and
s/$test_attribute/$attribute_to_retain
Just a little thing that could make the test easier to follow. It's nicely put together so I think naming may help more than additional commments that may add noise.
It's worth specifying (perhaps more concisely than me) that this paragraph-like element is not an allowed tag, so the
wrapping is expected when inline is the expected upcast behavior. This would mitigate any impressions that this test is inadvertently masking a bug.
Comment #19
andregp commentedHere I tried to address the points on #18
Comment #20
lauriiiThank you @andregp!
Comment #21
wim leersRTBC++
Comment #24
bnjmnmThanks all!
Committed to 9.4.x and 10.0.x, leaving at RTBC for 9.3.x in case it can be added after the @ckeditor5 version difference is reconciled.
Comment #25
wim leersAdded to #3269651: Update Drupal 9.3.x to CKEditor 5 v34.0.0 along with other un-backported issues — do we want to mark this then?
Comment #26
bnjmnmThanks @Wim Leers! I somehow missed that #3269651: Update Drupal 9.3.x to CKEditor 5 v34.0.0 along with other un-backported issues was keeping track of the queued issues.
Fixed!
Comment #27
xjmPostponing for backport after the v33 and v34 update.
Comment #28
catchv34 is in, so this is unblocked.
Comment #29
lauriiiComment #30
lauriiiMoving to RTBC since the backport was very straight forward and tests are passing
Comment #32
bnjmnmYep, the backport is a pretty safe change, it's 99% the recompiled build (which tests would 100% spot problems with) and an encoding difference of the Llama emoji in a test, which can safely be different as its encoding has no impact on the test.
So, it's backported to 9.3! Glad CKEditor 5 v34 is with us!