Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relation widget does not change when referenced item is deleted #5750

Closed
ConnorGDevelopment opened this issue Aug 25, 2021 · 1 comment
Closed
Labels
duplicate type: bug code to address defects in shipped code

Comments

@ConnorGDevelopment
Copy link

ConnorGDevelopment commented Aug 25, 2021

Context:
I currently have a site where the products are managed in a folder collection (will refer to this as the "Catalog"), this is where the base data for a product is stored. I also have a file collection that includes a file for managing the order in which the products are displayed (will refer to this as the "Display Order"). In the "Display Order", I have a list widget where the list items are relation widgets.

Bug:
When a product is removed from the "Catalog" any relation widgets referencing that deleted product in the "Display Order" are not updated.

Expected Behavior:
There should be some kind of error or behavior for when an item referenced by a relation widget is removed.

Applicable Versions:

  • Framework: Nuxt (Followed the Nuxt guide here https://www.netlifycms.org/docs/nuxt/)
  • Netlify CMS version (copied from console): netlify-cms-app 2.15.39, netlify-cms-core 2.47.2, netlify-cms 2.10.159
  • Git provider: GitHub
  • OS: Windows 10
  • Browser version: Google Chrome Version 92.0.4515.159
  • Node.JS version: v14.16.0

CMS configuration:
Note: This is an abbreviated version as the file is quite large.

---
backend:
  name: git-gateway
  branch: main

local_backend: true

media_folder: static/img
public_folder: /img

collections:
  - label: Urn Catalog
    name: urns
    folder: content/catalog/urns
    label_singular: Urn
    create: true
    slug: "{{fields.title}}"
    editor:
    preview: false
    fields:
      - {
          label: Collection Name,
          name: title,
          widget: string,
          hint: Ex. Maus - Earth",
        }

  - label: Data
    name: data
    editor:
      preview: false
      files:
        - label: Urn Display Order
          name: urn-display-order
          file: content/data/urn-display-order.md
          fields:
            - { label: Title, name: title, widget: hidden }
            - label: Urn Display Order
              name: order
              widget: list
              label_singular: "Urn"
              summary: "{{fields.item}}"
              field:
                {
                  label: Urn Collection,
                  name: item,
                  widget: relation,
                  collection: urns,
                  value_field: "{{slug}}",
                  search_fields: [title],
                  display_fields: [title],
                }
---

Additional:
I know my setup may be unusual and would appreciate information on how to improve it.

@ConnorGDevelopment ConnorGDevelopment added the type: bug code to address defects in shipped code label Aug 25, 2021
@erezrokah
Copy link
Contributor

Hi @ConnorGDevelopment, closing this issue in favor of #192.

Specifically see #192 (comment) and #192 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants