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

Bugfix entries batch edit localized fields #1475

Closed fredrikkarlsson-pervanovo closed 3 years ago

fredrikkarlsson-pervanovo commented 3 years ago

Batch edit is broken in two different ways when working with entries with localized fields:

Since fields (in entries-batchedit.tag) does not contain the localized names, field will be null and the required fields code will have a NPE when saving. Localized fields are added to fields _fields and therefore those should be used to look for localized fields.

When batch editing entries with a selected language, the entries will have empty root fields overwritten by their the selected language field value. The easiest fix is to only allow batch editing while viewing entries in the default language. The nice fix is to implement patch updating to collection entries and only change the provided fields. I went for the easy fix this time ;)

aheinze commented 3 years ago

Thanks!

fredrikkarlsson-pervanovo commented 3 years ago

Thank you! It would be awesome if you considered some of the other PR's I have made. They have all been battle tested by my organisation since they were created