Cockpit CMS Content Validation Addon
This addon examines all collection items for common error patterns and displays a list of errors/warnings.
- Confirm that you have Cockpit CMS (Next branch) installed and working.
- Download zip and extract to 'your-cockpit-docroot/addons' (e.g. cockpitcms/addons/ContentValidation, the addon folder name must be ErrorCheck)
- Confirm that the ContentValidation icon appears on the top left of the modules menu.
The AddOn adds a new menu item item "Content Validation". Navigating to it you will see a list of errors identified
Currently the plugin detects the following errors:
- Required fields that are empty (can happen if the required attribute was added later)
- CollectionLink field values that link to collection types that no longer exist
- CollectionLink field values that link to collection items that no longer exist
- Image fields with values(urls) that are no longer valid
Additionally it will warn if a GIF image is used since gatsby-image-sharp cannot process GIF images.
The current plugin is a quick prototype that I hacked together in a few hours on the weekend. But while the code needs some major cleanup it is already pretty useful and helped me identify a number of errors. I hope
- Code cleanup/follow coding patters used for other addons
- Add support for Singletons
- Add support for Regions
- Add support for set type
- Add support for repeater type
- Add support for asset fields
- Add support for gallery fields
- Settings page to enable/disable validations
There is also some other functionality that I might consider adding to the plugin
- Data cleanup; when removing a field the corresponding values stay in the data object which might cause confusion later on.
- Collection Link name update: when changing the name of a linked collection item this change isn't reflected in the link itself which can lead to some confusion down the line.
Ideally this sort of cleanup can optionally happen automatically using a cron job every night.
Copyright and license
Copyright 2019 Markus Oehler under the MIT license.