agentejo / cockpit

Add content management functionality to any site - plug & play / headless / api-first CMS
http://getcockpit.com
MIT License
5.4k stars 524 forks source link

Collection List Blank on broken Content Link #1505

Open gonzacaminos opened 1 year ago

gonzacaminos commented 1 year ago

Hi there!

I populated a collection list through the API and I missed the _id field for the Content Link, so the data sent was:

{
 "model": "Books"
}

Instead of

{
 "model": "Books",
"_id": "123456"
}

I couldn't browse those items on the admin to delete them so I had to do a local override to fix the issue on modules/Content/assets/vue-components/field-content-item-link.js

On line 26 I added safe browsing and it worked:

Before: return${value._id.substr(-5)}

After: return${value?._id?.substr(-5)}