- 🇳🇿New Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies → .
When using a custom constraint defined in a module in multiple modules, the addConstraint() method assumes that the constraint is unique per entity type. Expected behaviour would be that whenever we use the addConstraint() it should not overwrite the existing constraint on the entity type.
Let's say we have defined a nodeLimit constraint in a module that would allow to create only a certain number of nodes of given content type. When we want to use this constraint in multiple modules, we assume that using addConstraint() in module1_entity_type_alter() and module2_entity_type_alter() preprocess function, the constraint should be applied correctly to both content types. But in our case, only the module2 constraint works.
If addConstraint() should be used on a single content type, the documentation should make it clearer.
Our workaround was to overwrite addConstraint() in the custom constraint to accept arrays so for example addConstraint(['node1', 'node2'])
Active
10.3 ✨
entity system
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies → .