Problem/Motivation

I want to delete Entity Legal version(documents).

Steps to reproduce

Go to Entity Legal, edit and try to remove a version.

Proposed resolution

  • Create new routing.
  • Add 'delete' url in EntityLegalDocumentForm.
  • Create a new permission 'delete entity legal versions'.

User interface changes

Add a delete button in documents.

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

saidatom created an issue. See original summary.

saidatom’s picture

Status: Active » Needs review
dimilias’s picture

Status: Needs review » Needs work

I have two more issues with the implementation. First, we are lacking tests.
Second, the module has 3 entities. EntityLegalDocument, EntityLegalDocumentVersion and EntityLegalDocumentAcceptance.
The acceptance entity holds users that have accepted a specific version. We need somehow to be able to cleanup these acceptances once a version is deleted.
Please, note, that this should not be done with a direct deletion. It would be better to be a batched or cron process because in a large scale website, there might be millions of entities to delete.

saidatom’s picture

Status: Needs work » Needs review

@idimopoulos delete the actual accepted versions was already implemented in old code. If you check delete from EntityLegalDocument they are deleting child's in that case documents and accepted versions. Do we need to implement that new approach to delete the accepted versions in batch/cron?

dimilias’s picture

Status: Needs review » Reviewed & tested by the community

@saidatom, no the new changes suffice for the scope of the ticket. Users are now able to delete documents. If the accepted versions are also cleaned, that is fine for me. +1 RTBC here.

dimilias’s picture

Please, note that the failing tests are irrelevant. There is a separate ticket for this and the new test is working fine.

claudiu.cristea’s picture

Status: Reviewed & tested by the community » Fixed

Thank you!

claudiu.cristea’s picture

Fix credits.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.