- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Closed โจ CKEditor 5 doesnt support directory tokens for inline images Closed: duplicate as a duplicate of this.
This patch is correctly updating
editor_image_upload_settings_form()
andEditorImageDialog
. ButEditorImageDialog
is going away: ๐ Deprecate EditorLinkDialog, EditorImageDialog and EditorMediaDialog in Drupal 10.1 for removal in Drupal 11 Fixed . Still, CKEditor 5's\Drupal\ckeditor5\Plugin\CKEditor5Plugin\Image::buildConfigurationForm()
continues to calleditor_image_upload_settings_form()
.Which brings up an interesting question โฆ perhaps this should actually be converted into a CKEditor 5 issue? due to #3231341, the bulk of the changes would actually have to happen in the CKEditor 5 module, not the Text Editor module?
Also related: ๐ฑ [META] Discuss: merge the Editor config entity into the FilterFormat config entity Active , at which point it quite possibly makes sense to drop
\Drupal\editor\EditorInterface::getImageUploadSettings()
altogether? The very reason that configuration was stored on the general Text Editor config entity was to maximize the ability to switch between different text editors back in #1833716: WYSIWYG: Introduce "Text editors" as part of filter format configuration โ , over 10 years ago ๐ณ, by putting configuration that could be shared between text editors in the general Text Editor config entity rather than the text-editor-plugin-specific settings.But in that decade, no notable alternative text editor has sprung up in the contributed module space. So why keep this API surface complexity? Why not drop it exactly at the time when we are modifying
EditorInterface
anyway (i.e. merging it withFilterFormatInterface
).Tagging for that.
- ๐จ๐ณChina g089h515r806
For Ckeditor5 in drupal 10, 1 line code change could fixed it:
change
$destination = $image_upload['scheme'] . '://' . $image_upload['directory'];
to
$destination = $image_upload['scheme'] . '://' . \Drupal::token()->replace($image_upload['directory']);
in upload function of file core\modules\ckeditor5\src\Controller\CKEditor5ImageController.php
- ๐ฎ๐ณIndia Akshay kashyap
Akshay kashyap โ made their first commit to this issueโs fork.
- last update
over 1 year ago 29,366 pass - @akshay-kashyap opened merge request.
- ๐ฌ๐งUnited Kingdom alexpott ๐ช๐บ๐
@Wim Leers so should we block this on ๐ฑ [META] Discuss: merge the Editor config entity into the FilterFormat config entity Active ? My gut feel is that we should do the smallest change possible here and only change ckeditor5. And if ๐ฑ [META] Discuss: merge the Editor config entity into the FilterFormat config entity Active goes ahead it'll take care of the other stuff in #30.
FWIW we can use
\Drupal::token()->replacePlain()
here. - last update
over 1 year ago 29,366 pass - @g089h515r806 opened merge request.
- last update
over 1 year ago Custom Commands Failed - Status changed to Postponed
over 1 year ago 7:03pm 19 May 2023 - ๐บ๐ธUnited States smustgrave
#34 makes it sound like this should be postponed. Or moved to ckeditor5.
- ๐ท๐บRussia Alezu
Let me put this temporary patch for CKEditor5 here.
Just for note - at least the old ckeditor seems to be loaded without any context, so it's hardly possible to use any tokens except global ones there. all these patches work only with the date? I'm trying [node:nid] and it doesn't work (#38) :(
- ๐ท๐บRussia Alezu
Hi Anche, there is an example of workaround for a similar case. https://drupal-coder.ru/blog/privatnye-kartinki-ckeditor-drupal-dinamich...
The post is in Russian but everything is clear from the code. Alezu, thanx a lot! It helps me.
ะฝะฐ ััััะบะพะผ ัะพ, ััะพ ะฝะฐะดะพ! ;)- ๐บ๐ธUnited States loze Los Angeles
here's a reroll of the temporary fix in #38 that should work with 10.3.0
- Status changed to RTBC
2 months ago 9:50am 23 October 2024 - ๐ฎ๐นItaly kopeboy Milan
Patch #42 worked with Drupal 10.3.6 too!
I tested
inline-files/[date:custom:Y]-[date:custom:m]
as suggested in issue body.Maybe we want separate follow up issues for:
- improving the UX, for example by adding a link to Browse available tokens
- making other tokens (non-globally available ones) work, for example related to the parent entity having the CKE text field (for example [node:nid] doesn't work, as expected?).
- ๐ญ๐บHungary mxr576 Hungary
Moving back to needs work since the "needs test" tag is on the issue and I haven't seen any test coverage in MR#3891 so far.
- ๐ฌ๐งUnited Kingdom SirClickALot Somerset
Patch #42 works in Drupal 10.3.10.
Personally, I think this is is quite a crucial feature to have because without it, sites'
sites/default/files/inline-images
folders will be in danger of becoming dangerously bloated, I know mine is!