decaporg / decap-cms

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

CMS crashes after showing this message: "Decap CMS is adding labels to 2 of your Editorial Workflow entries." #7082

Closed vk4s closed 4 months ago

vk4s commented 5 months ago

Describe the bug Decap CMS is adding labels to 2 of your Editorial Workflow entries. The "Workflow" tab will be unavailable during this migration. You may use other areas of the CMS during this time. Note that closing the CMS will pause the migration.

This message is shown every time I try to create a new post or edit existing post from the workflow option. It says it's doing something. But I don't see any change in the CMS or in the GitHub repo. I have been seeing this error for over 8 months. But now it crashes the CMS. I have lost many blog posts because of it. So, now I have to keep saving the post of copy it locally.

To Reproduce

  1. Go to 'workflow'
  2. Click on 'any one of the posts'
  3. See the error

Expected behavior

It should not crash the page and complete the "adding label".

Screenshots

Applicable Versions:

CMS configuration

# ---- Custom
# backend:
#   name: proxy
#   proxy_url: http://<redacted>/api/v1
#   branch: main

# ---- Production (default)
backend:
  name: git-gateway
  branch: main

publish_mode: editorial_workflow

logo_url: <redacted>
display_url: /

media_folder: "/static/images/uploads"
public_folder: "/images/uploads"

search: true
show_preview_links: true

slug:
  encoding: "ascii"
  clean_accents: true
  sanitize_replacement: "-"

# collections
collections:
  - name: "post" # Used in routes, e.g., /admin/collections/blog
    preview_path: "preview/{{year}}/{{month}}/{{slug}}"
    label: "Posts" # Used in the UI
    label_singular: "Post"
    folder: "content/posts" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    # slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
    slug: "{{year}}{{month}}{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
    fields: # The fields for each document, usually in front matter
      - {label: "Layout", name: "layout", widget: "hidden", default: "_default"}
      - {label: "Title", name: "title", widget: "string"}
      - {label: "**Slug/URL** [leave this field empty to use the title as slug and do not change the value after publishing the story]", name: "slug", widget: "string", required: false}
      - {label: "**Draft** [turn it off before publishing otherwise the post will not be published]", name: "draft", widget: "boolean", required: true, default: true}
      - {label: "Summary", name: "description", widget: "string", required: false}
      - {label: "URL aliases [split by comma. no need to add]", name: "aliases", widget: "list", required: false}
      - {label: "Header Image [Featured Image]", name: "header_img", widget: "image", required: false}
      - {label: "Publish Date", name: "date", widget: "datetime"}
      - {label: "Update Date", name: "lastmod", widget: "datetime", required: false, default: now}
      - {label: "Is Updated", name: "isUpdated", widget: "boolean", required: false, default: false}
      - {label: "Tags", name: "tags", widget: "list", allow_add: true}
      - {label: "Categories", name: "categories", widget: "list", allow_add: true, required: false}
      - {label: "Series", name: "series", widget: "list", allow_add: true, required: false}
      - {label: "Table of content", name: "toc", widget: "boolean", required: false, default: true}
      # - {label: "Draft", name: "draft", widget: "boolean", default: false}
      - {label: "Body", name: "body", widget: "markdown"}
      - {label: "Math", name: "math", widget: "boolean", default: false, required: false}
    sortable_fields: ['date', 'lastmod', 'title', 'description']
    view_groups:
      - label: Year
        field: date
        # groups items based on the value matched by the pattern
        pattern: \d{4}
      - label: Series
        field: series
      - label: Tags
        field: tags
      - label: Categories
        field: categories
    view_filters:
      - label: Drafts
        field: draft
        pattern: true
    editor:
      preview: true

  - name: series
    label: Series
    label_singular: 'Series'
    folder: content/series
    create: true
    # adding a nested object will show the collection folder structure
    slug: "{{slug}}"
    nested:
      depth: 100 # max depth to show in the collection tree
      summary: '{{title}}' # optional summary for a tree node, defaults to the inferred title field
    fields:
      - label: Title
        name: title
        widget: string
      - label: Description
        name: description
        widget: text
        required: false
      - label: "Header Image (Featured Image)"
        name: "header_img"
        widget: "image"
        required: false
      - label: Short
        name: short
        widget: boolean
        default: true
      - label: Body
        name: body
        widget: markdown
        required: false
        hidden: true
    meta: { path: { widget: string, label: 'Path', index_file: '_index' } }

  - name: About
    label: About Page
    label_singular: 'About'
    folder: content/about
    create: true
    slug: "{{slug}}"
    fields:
      - label: Title
        name: title
        widget: string
      - label: Aliases
        name: aliases
        widget: list
        required: false
      - label: Description
        name: description
        widget: text
        required: false
      - label: Date
        name: date
        widget: datetime
        default: now
        required: false
      - label: "Header Image (Featured Image)"
        name: "header_img"
        widget: "image"
        required: false
      - label: Body
        name: body
        widget: markdown
        required: false

    # adding a meta object with a path property allows editing the path of entries
    # moving an existing entry will move the entire sub tree of the entry to the new location
    meta: { path: { widget: string, label: 'Path', index_file: '_index' } }

Additional context

daz079 commented 4 months ago

Not a fix, but I had this issue and I got around it by simply going to my repo, removing all tags related to netlify on the PRs and then creating a new one with the same format and decap,

So one example in my Github for PRs is: "decap-cms/draft"

I just created the tag and applied it to all posts that had Netlify tags on them, after I migrated. I then manually dragged stuff over in the Workflow, for posts that were awaiting review etc

vk4s commented 4 months ago

Hello, @daz079 Thanks for your comment. I had recently migrated from netlify cms to decap cms and completely missed the part of Netlify CMS' old labels. Your comment reminded me. I had exactly 2 pull requests with netlify-cms/draft after removing those pr. I no longer see the message.

Thanks again. Have an awesome day. V


For others having similar issue:

  1. Check all the pr that have the netlify-cms/draft labels.
  2. Remove them or change the labels to decap-cms/draft.
  3. Redeploy the site.
daz079 commented 4 months ago

Glad I could help, you have an awesome day too