- ๐ฎ๐ฉIndonesia el7cosmos ๐ฎ๐ฉ GMT+7
This can potentially break contribs that calls this function
- ๐ฉ๐ชGermany rgpublic Dรผsseldorf ๐ฉ๐ช ๐ช๐บ
Yes, that's right. Although I wonder how many contribs actually use this. TBH, I only discovered this method due to this bug. I couldn't find any documentation on this. Neither any info on the related Drupal.ckeditor.openDialog.
Especially due to the missing existingValues param this method (in contrast to the version for CK4) is almost useless, I guess. I resorted to a direct Drupal.ajax() call for now.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
@mglaman Any chance you could write a test? ๐ค๐๐
- Assigned to mglaman
- ๐บ๐ธUnited States mglaman WI, USA
Yeah, I'll see what I can do. I'll pick this up for Monday.
- ๐จ๐ฆCanada klimp Montrรฉal, QC
Why not make existingValues the last parameter and default it to {}? This way we won't break any contrib calling this method without it
ckeditor5.es6.js has been removed since the previous patch
- ๐จ๐ฆCanada klimp Montrรฉal, QC
Also attaching the Drupal 9 patch version which includes ckeditor5.es6.js
- ๐ฉ๐ชGermany rgpublic Dรผsseldorf ๐ฉ๐ช ๐ช๐บ
The only argument against it would perhaps be the symmetry to the CKE4 version. But I don't really oppose the idea. Just a thought.
- ๐จ๐ฆCanada klimp Montrรฉal, QC
I see 2 options here:
- keep the CKE4 parameters order in sake of the symmetry. Expect issues with the contrib modules calling Drupal.ckeditor5.openDialog. Not sure if there is a way to evaluate how many of them actually do that. Anyways this approach would require collaboration with the maintainers of each of those modules
- move the existingValues param at the end and default it to {} as I did in the patches #11 and #12. Given the difference between CKE4 and CKE5 I think that the parameters inconsistency is less evil than having to adjust contrib modulesOne way or another I needed these patches in order to make the insert_view_adv contrib module work https://www.drupal.org/project/insert_view_adv/issues/3356931 ๐ CKEditor 5 plugin doesn't default to the selected view when editing Needs work
- ๐จ๐ฆCanada b_sharpe
I'd be in favor of option 2.
Anyone who has used this function in CKE5 so far obviously hasn't used existing values or else would have needed a patch/custom solution, so better to keep the function backwards compatible
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
The primary thing missing here is test coverage. Any takers? ๐๐ค
- ๐จ๐ฆCanada b_sharpe
Just adding that there isn't currently a test for this without the patch. Currently only the media library plugin calls this function in core (see
core/modules/ckeditor5/ckeditor5.ckeditor5.yml
) - ๐ฉ๐ชGermany rgpublic Dรผsseldorf ๐ฉ๐ช ๐ช๐บ
@Wim Leers. Very good question. I asked myself the same thing. The answer is: The Drupal Media Library plugin has no edit feature. If you click on the "Insert media" button a dialog is opened and you can select a media file. The media file is then inserted at the cursor position. However, there is no real way to "edit" the media file. You cannot double-click and if you highlight the media item and click on the button again, just normal dialog is opened again but the current file is not preselected. It's okay-ish I guess for this use-case. It would be nicer though, if the library would preselect the file. If you use sth. like media_directories this gets worse because you have to select the same folder again. Long story short, there currently isn't any information flow from CKEditor to the dialog - only from the dialog back to CKEditor. That's why this feature isn't needed.
- last update
over 1 year ago Custom Commands Failed