1.0.2 • Published 2 years ago
strapi-plugin-validate-relations v1.0.2
Strapi plugin Validate Relations for Publication
This plugin allows the validation of publication to check whether the relations are PUBLISHED.
Installation
npm install strapi-plugin-validate-relations
yarn add strapi-plugin-validate-relations
Good to know
The populate depth is calculated by strapi built-in capability (i.e. WYSIWYG). Deeper nested relations will not be validated if it's not explored by the populate.
e.g. the relation chain is:
Homepage->Menu->Link, when editingHomepage, it will not validate if theLinkconnected to aMenuis DRAFT since the populate ofHomepagewill not include it, however, if the selectedMenuis DRAFT, error will be returned.
Currently the plugin will throw the validation error immediately when a DRAFT relation is found.
Configuration
Example configuration
config/plugins.js
module.exports = ({ env }) => ({
'strapi-plugin-validate-relations': {
enabled: true
},
});Sample Validation Results
- Publishing without required relation

- Publishing with a DRAFT relation

- Publishing with a published relation successfully
