Problem/Motivation

When a CM Document is saved, validation should prevent save if there is already a CM document for that entity or entity:field combination.

The system should never have two documentations for the same thing.

blocked by https://www.drupal.org/project/content_model_documentation/issues/3334959

Steps to reproduce

Proposed resolution

The approach should be similar to what is done in the allow_only_one module.

However that module can not be used directly because cm_document entity type is not supported by that module and there os no good reason to extend that module to use it.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

swirt created an issue. See original summary.

swirt’s picture

Title: Add validation to make ensure only one » Add validation to make ensure only one doc per entity
swirt’s picture

Issue summary: View changes
swirt’s picture

This is less critical now that https://www.drupal.org/project/content_model_documentation/issues/3346158 has been resolved.

Validation is still important, but not as critical.

Additional note: Validation will have to exempt applying to site.note, site.process and site.principle as these can have multiples of the same type creates as they are not entity specific.

swirt’s picture

Title: Add validation to make ensure only one doc per entity » Add validation to enforce only one doc per entity being documented
swirt’s picture

Priority: Major » Normal

JayDarnell made their first commit to this issue’s fork.

jaydarnell’s picture

I believe I have this one sorted @swirt

  • swirt committed cd43bc13 on 1.0.x authored by JayDarnell
    Issue #3339247: add validation to enforce one doc per entity type
    
swirt’s picture

Status: Active » Fixed

Thank you for this contribution @JayDarnell.

This will go out with 1.0.5

swirt’s picture

Status: Fixed » Closed (fixed)