U4-10201 - Exception when deleting a user's start node

Created by Stephan 26 Jul 2017, 12:52:04 Updated by Sebastiaan Janssen 24 Aug 2017, 18:04:50

Subtask of: UAASSCRUM-1073

Repro: assign a start node to a user (will create a row in umbracoUserStartNode), then delete that start node (will go to the trash bin), then empty the trash bin.

Result: reference constraint exception, cannot delete the node bc it's referenced as a start node.

Expected: delete works, node is not a start node anymore (I assume?).

Comments

Shannon Deminick 08 Aug 2017, 05:18:43

Other issues:

  • We are missing FKs on the umbracoUserGroup table for start nodes (media and content)
  • When these FKs are added we will have this same problem

We need to:

  • Add the FKs on the DTOs
  • Add the FKs during the migration if they don't exist - but we may need to clean some data first before adding them because the contraints were not there at beta release
  • Update the content and media services - both the GetDeleteClauses + the formatted SQL for emptying the bin to remove frmo both umbracoUserGroup table and the umbracoUserStartNode table


Shannon Deminick 09 Aug 2017, 14:06:53

PR: https://github.com/umbraco/Umbraco-CMS/pull/2117

To test:

Change your web.config version to 7.6.0 which will make the installer run - make sure no errors are reported, then check in your db to see if the Foreign keys were added: FK_startContentId_umbracoNode_id, FK_startMediaId_umbracoNode_id to the umbracoUserGroup table

Create a content and media item

Create a user group and assign the content and media start nodes to the ones just created

Create a user and assign content and media start nodes to the ones just created

Delete the content item just created, expand the recycle bin and delete just that content item again - ensure

Delete the media item just created, expand the recycle bin and delete just that media item again - ensure no errorsno errors

Do step 2 -> 4 again

Delete the content item just created, empty the recycle bin - ensure no errors

Delete the media item just created, empty the recycle bin - ensure no errors


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.7.0

Sprint: Sprint 66

Story Points: 1

Cycle: