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

New item not found on relation widget (in the same browser used to create it) #4841

Open
PedroOndh opened this issue Jan 14, 2021 · 0 comments

Comments

@PedroOndh
Copy link

PedroOndh commented Jan 14, 2021

Describe the bug
When i add a new entry in author collection appears on the list, but it is not selectable through the relation widget from other articles.

If I hardcode the id of the author, Netlify CMS doesn't find it and return an error. If I access from any other browser or in incognito mode this error disappear and the author is found. But the error remains even after cleaning the cache on the original browser.

To Reproduce

  1. Go to collection A and create a new item
  2. Go to an item on collection B and search in the relation widget (connected to collection A) the new item
  3. Item is not found, if hardcoded Netlify CMS will return an error.

Expected behavior
Find the new item in the collection

Screenshots
netlifycms-relation-widget-error

Applicable Versions:

  • Netlify CMS version: 2.10.81
  • Git provider: BitBucket
  • OS: macOS Catalina
  • Browser version: Chrome (maybe happens in other browsers, but as it's dependand on cookies/localStorage or some similar issue couldn't replicate it)

CMS configuration

backend:
  name: bitbucket
  repo: xxxxxx/cbn-jekyll-cms # Path to your Bitbucket repository
  branch: develop
  auth_type: implicit
  app_id: xxxxxxxx

# for using local backend run "npx netlify-cms-proxy-server" and enter in /admin
local_backend: true

media_folder: "assets/media/uploads"
logo_url: https://xxx/assets/media/logo/logo-animated.gif
display_url: https://xxx

collections:
  - name: "blog"
    label: "Blog"
    label_singular: "Blog post"
    description: "Entries sortable by Publish Date or title on 'Sort by' button"
    folder: "collections/_posts"
    filter:
      field: "categories"
      value: "blog"
    sortable_fields: ['publish-date', 'title']
    view_filters:
      - label: '2020'
        field: "publish-date"
        pattern: '2020'
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    fields:
      - {label: "Layout", name: "layout", widget: "hidden", default: "post"}
      - {label: "Post Category", name: "categories", widget: "hidden", default: "blog"}
      - {label: "Post Author", name: "author", widget: "relation", collection: "team-members", search_fields: ["name","email"], value_field: "email", display_fields: ["name"], required: false}
      - {label: 'Cover Image', name: 'image', widget: 'image', tagname: '', hint: "File type: PNG / File size: as small as possible (Ask designer)"}
      - {label: "Publish date", name: "publish-date", widget: "datetime", format: "YYYY-MM-DD HH:mm a", default: ""}
      - {label: "Title", name: "title", widget: "string", tagname: "h1"}
      - {label: "Subtitle", name: "subtitle", widget: "string", tagname: "h3", required: false}
      - {label: "Permalink", name: "slug", widget: "string", hint: "The URL of this post. WARNING: IF YOU EDIT THIS FIELD YOU CANNOT LEAVE IT BLANK", pattern: ["^[a-zA-Z\\-0-9]+$", "Must not have whitespaces and not being empty"], required: false}
      - {label: 'Meta Description', name: 'description', widget: 'string', required: false}
      - {label: "Body", name: "body", widget: "markdown"}
      - {label: "Tags", name: "tags",  widget: select, options: ['Products', 'Engineering', 'Customers', 'News', 'Retail', 'Insights', 'Search', 'UX'], multiple: true}
[...]

  - name: "team-members"
    label: "Team Members"
    label_singular: "Team Member"
    folder: "collections/_team-members"
    create: true
    slug: "{{slug}}"
    sortable_fields: ['name']
    identifier_field: name
    fields:
      - {label: "Name and Last Name", name: "name", widget: "string"}
      - {label: "Job title", name: "jobtitle", widget: "string"}
      - {label: "Image", name: "image", widget: "image"}
      - {label: "Team", name: "team", widget: select, options: ["Leadership", "Search", "Interface", "Data", "UX","Operations","DevOps","Enterprise","Delivery", "Play", "Motive"]}
      - {label: "Email", name: "email", widget: "string"}
      - {label: "Description", name: "body", widget: "markdown", required: false}
      - label: "Social Media"
        name: "social-media"
        widget: "list"
        required: false
        fields:
          - {label: Social Media Name, name: name, widget: select, options: ["Facebook", "Twitter", "Instagram", "Linkedin", "Google"]}
          - {label: URL, name: url, widget: string, hint: "For example: https://www.instagram.com/username/"}
      - {label: "Birth date", name: "birthday", widget: "datetime", format: "YYYY-MM-DD HH:mm a", default: "", required: false}
      - {label: "Tags", name: "tags",  widget: select, options: ['Products', 'Engineering', 'Customers', 'News', 'Retail', 'Insights', 'Search', 'UX'], multiple: true}
      - {label: "Active", name: "active", widget: "boolean", default: true}
@PedroOndh PedroOndh added the type: bug code to address defects in shipped code label Jan 14, 2021
@PedroOndh PedroOndh changed the title Please replace with a clear and descriptive title New item not found on relation widget in the very same browser Jan 14, 2021
@PedroOndh PedroOndh changed the title New item not found on relation widget in the very same browser New item not found on relation widget (in the same browser used to create it) Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants