decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.7k stars 3.03k forks source link

Canceling 'from insert URL' is causing a bug #6982

Closed olegfedak closed 8 months ago

olegfedak commented 8 months ago

Describe the bug I have been experiencing an issue with an existing image in the field widget. When I'm opening it to insert an image URL but then clicking cancel, the image gets lost.

To Reproduce Assuming, there is image added through image widget before.

  1. Go to 'field widget image'
  2. Click on 'Insert from URL'
  3. See modal window
  4. Click on 'Cancel'
  5. The image is lost

Expected behavior 'Cancel' just closes modal window.

Screenshots https://github.com/decaporg/decap-cms/assets/5526547/8c7dd76f-0ebe-47ba-85db-7b0bd4858794

Applicable Versions:

CMS configuration

---
local_backend: true
backend:
  name: github
  repo: mohamedhaddi/trust-and-explore
  branch: changes
logo_url: /assets/img/adminLogo.svg
media_folder: "src/assets/img/" 
public_folder: "/assets/img/"
site_url: /
collections:
  - label: "Blog"
    label_singular: 'Post'
    name: posts
    folder: src/posts
    create: true
    editor:
      preview: true
    preview_path: blog/{{title}}
    fields:
      - label: "Title"
        name: title
        widget: string
      - label: "Description"
        name: description
        widget: text
      - label: "Image"
        name: image
        widget: image
      - label: "Author"
        name: author
        widget: string
      - label: "Publish Date"
        name: date
        widget: datetime
      - label: "Categories"
        name: categories
        widget: select
        multiple: true
        create: true
        options: ["news","industry","expirience","tips","articles","nature"]
      - label: "Body"
        name: body
        widget: markdown