I am using the drupal 9.4.8 version in my application . While create a page using ckeditor, When inserting a image in the CKeditor, we facing image was stored in temporary status , it cause temporary image delete after 6 hours , i resolved that as patch for image upload as permanent in status updated . I think it is useful another application you face same issue .

Comments

suresh_m created an issue. See original summary.

cilefen’s picture

Issue summary: View changes
Status: Needs work » Postponed (maintainer needs more info)
Issue tags: -image upload, -ckeditor, -ckeditor5, -wysiwyg ckeditor +Needs steps to reproduce

Thank you for posting a patch. For a bug fix in core we need very clear steps to reproduce please.

suresh_m’s picture

StatusFileSize
new119.04 KB
new175.46 KB
new219.42 KB

Here attached the screen shot for reproduced above issue .
Step 1 . Choose the image insert via Ckeditor refer step1.jpg
Step 2. After save the data ,check in file show the file status as Temporary refer step2.jpg
Step 3. After apply the patch it should show the file status as Permanent refer step3.jpg

cilefen’s picture

By "steps to reproduce" what I mean are directions for setting up Drupal in such a way that the bug is exhibited. As far as I know it is uncommon for what you reported to occur.

cilefen’s picture

Version: 9.4.x-dev » 9.5.x-dev

Also: Drupal 9.5 is the general bug fix target branch because there will only be security bug fix releases of 9.4.

nuwans’s picture

Version: 9.5.x-dev » 10.0.x-dev

Same problems with drupal 10.0.9 on a custom form /WYSIWYG field, But the patch is not working

But the problem is resolved bu using this method : https://drupal8.ovh/en/tutoriels/437/ckeditor-inline-image-files-usage-custom-forms

jeremie_alvin’s picture

@suresh_m it's actually normal to have a 'temporary' status on an uploaded image.
Drupal stores inline images as temporary at first, but when you save the entity, Drupal triggers a status change to make it permanent.
Can you explain a bit more the steps involved in reproducing your error and whether the image remains temporary after the entity has been saved?

bhuvaneshwar’s picture

The same problems with Drupal 10.1.4 on a custom form, Block's /WYSIWYG field, And the patch is not working either after saving the entity.

When I use the code as per this article is it working fine https://drupal8.ovh/en/tutoriels/437/ckeditor-inline-image-files-usage-c....

Version: 10.0.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

pameeela’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Issue tags: +Bug Smash Initiative

This definitely does not occur in default CKE in core. The image is temporary when first uploaded, and becomes permanent when you save the node. If this is not working on a custom form, you are probably missing a step in your custom code.

dakwamine’s picture

Tested on 10.3.7.

I confirm this does not happen with ckeditor5 from Drupal's core.

It happens with the contrib module ckeditor, the one created temporarily for the migration between cke4 and cke5.

My advice is then to enable the core ckeditor5 module, then switch all your text formats using the old editor to CkEditor5.

If you have errors when saving the text format, you may need to update your contrib modules which provide plugins for ckeditor.

apparatchik’s picture

This issue is still ongoing in core 10.5.1 with core's ckeditor5 module.

Steps to reproduce is to have a custom form, for example, a module's settings form, and have a form field of type 'text_format' and format 'full_html'.

The uploaded image's in the ckeditor5 will do the usual saving to sites/default/files/inline-images with the corresponding File entities, but the logic to set them Permanent will be missing unless manually implemented (I assume in canonical entities' edit and add forms this logic is implemented somewhere), there's even a global function _editor_parse_file_uuids that extract File id's from an editor's text value.

These couple of articles explain what needs to be added to a custom form to have the proper logic in place:

https://www.codimth.com/blog/web/drupal/ckeditor-not-saving-inline-image...

https://drupal8.ovh/en/tutoriels/437/ckeditor-inline-image-files-usage-c...