- Do you want to request a feature or report a bug?
bug
- What is the current behavior?
If you put an invalid value for searchFields it fails with a "sorry there was an error", but no details anywhere what the error was.
In my case I created a new collection that had a relation widget field. I mistakenly set the searchFields value to "[title]" instead of ["title"]. What really threw me off was that it allowed me to create new pages for the collection, but the message-less error page would show up when I tried to edit created pages.
- If the current behavior is a bug, please provide the steps to reproduce.
- What is the expected behavior?
The error page should have a message stating the searchFields value is of the wrong type or that there is no field named the given value in the given collection.
And Thank you for all the great work you guys put into this software!
- Please mention your CMS, node.js, and operating system version.
1.0, v8.1.3 local ( not sure what version netlify uses), and Ubuntu Linux (but I was testing it on netlify's system through the web)
- Please link or paste your config.yml below if applicable.
I don't think this would be helpful but here it is:
- name: "sub_page"
label: "Sub Pages"
folder: "src/documents/sub_pages"
create: "true"
slug: "{{slug}}"
fields:
- {label: "Title", name: "title", widget: "string", tagname: "h1"}
- {label: "Navigation Bar Text", name: "navTitle", widget: "string"}
- {label: "Which Main Page to sort navigation button under.", name: "navNest", widget: "relation", collection: "main_page", searchFields: "[title]", valueField: "title"}
- {label: "Navigation bar priority (lower=farther up)", name: "navPriority", widget: "number"}
- {label: "Body", name: "body", widget: "markdown"}
#hidden fields are not editable by the user but still show up in the file's front matter
- {label: "Collection", name: "collection", widget: "hidden", default: "SubPage"}
- {label: "Layout", name: "layout", widget: "hidden", default: "default.html"}
meta:
- {label: "Publish Date", name: "date", widget: "datetime", format: "YYYY-MM-DD hh:mm:ss"}
Thanks for opening this, I'd love to see our error handling game improved. We implemented that error component to stop folks from working in a broken environment, unaware that the CMS stopped working long ago (this way we prevent data loss), but we haven't put it to work with useful error messages yet.
I would like to take a stab at this issue!
@solpark Great! If it helps you at all, the Error component is under /src/components/UI/ErrorBoundary/ErrorBoundary.js.
Hey @solpark - feel free to come holler at us in Gitter if you get stuck :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
I would like to take a stab at this issue!