processwire / processwire-issues

ProcessWire issue reports.
45 stars 2 forks source link

ckeditor save removes images #1093

Closed S1143455 closed 1 year ago

S1143455 commented 4 years ago

Short description of the issue When inserting an image through the CKEditor in your text, the file is not saved to the selected field. Expected behavior Select image through CKEditor and save it to the field you select in the 'Select Image' modal. Actual behavior

I have a environment with ProcessWire 3.0.145 installation. The image shows up in the CKEditor field after 'uploading' it, but after you save the page, no image was actually uploaded. There are no javascript errors. Steps to reproduce the issue Edit a page with a CKEditor field and an image(s) field. In the CKEditor field, have a image on your clipboard. Paste it in the field image is vissible and looks uploaded Click on 'submit'. Save the field.

after the save, the image is gone before the save: afbeelding

after the save: afbeelding

Setup/Environment

ProcessWire version: 3.0.145installed.
Browser: latest versions of Firefox and Chrome
ryancramerdesign commented 4 years ago

@S1143455 If you are copying an image from an HTTP accessible URL and pasting into your CKEditor field, depending on the browser, is will likely paste in an <img> tag with a src attribute to the URL where the image is located, rather than uploading an image file. You can tell if the file is uploaded by looking at your image field and seeing if it is in there, immediately after pasting. If you don't see a file in there, then that means the browser pasted an <img> tag rather than uploading an image. On the other hand, if you open some image file on your computer (in a software other than a web browser), drag to select some part (or all) of it, copy, and then paste into CKEditor, that should upload an actual file. However, rather than copying/pasting, I'd suggest just dragging in files if you can, so that you don't have to think about copy/paste whims of OS and browser.

S1143455 commented 4 years ago

@S1143455 If you are copying an image from an HTTP accessible URL and pasting into your CKEditor field, depending on the browser, is will likely paste in an <img> tag with a src attribute to the URL where the image is located, rather than uploading an image file. You can tell if the file is uploaded by looking at your image field and seeing if it is in there, immediately after pasting. If you don't see a file in there, then that means the browser pasted an <img> tag rather than uploading an image. On the other hand, if you open some image file on your computer (in a software other than a web browser), drag to select some part (or all) of it, copy, and then paste into CKEditor, that should upload an actual file. However, rather than copying/pasting, I'd suggest just dragging in files if you can, so that you don't have to think about copy/paste whims of OS and browser.

ah yes that explains it, i am indeed posting a image as paste instead of the file, i will test with the file, is it however not possible to paste an img instead of a file ?

matjazpotocnik commented 1 year ago

@S1143455 I tried on Edge and it's also pasting tag. It's best to follow Ryan's advice.