Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V15: Dont delete when referenced setting is enabled #18359

Merged
merged 11 commits into from
Feb 21, 2025

Conversation

Zeegaan
Copy link
Member

@Zeegaan Zeegaan commented Feb 18, 2025

Notes

  • We would not respect the ContentSettings.DisableDeleteWhenReferenced & ContentSettings.DisableDeleteWhenReferenced
  • This PR remedies that, by checking for the setting, and then using the relation service, to see if a given item is related.

How to test

  • Create a Document type with allowed as root set to true, create a "root" document from that
  • Create another document type with allowed as root set to true, AND a content picker property.
  • Create a document with the 2nd document type, and make sure to pick your first content with the content picker.
  • Stop the application
  • Overwrite the content section in your appsettings.json
      "Content": {
        "DisableDeleteWhenReferenced": true,
        "DisableUnpublishWhenReferenced": true,
        "Notifications": {
          "Email": "[email protected]"
        },
        "MacroErrors": "Throw"
      },
  • Run the application
  • Try to trash the referenced content, you should not be able to
  • Try to unpublish the referenced content, you should not be able to
  • Set "DisableUnpublishWhenReferenced": false,
  • Restart the app
  • Try to trash the referenced content, you should now be allowed
  • Try to remove it from the recycle bin, that should not be allowed

@kjac kjac self-requested a review February 19, 2025 11:52
Copy link
Contributor

@kjac kjac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm 💪

@kjac kjac merged commit 368f6eb into v15/dev Feb 21, 2025
20 of 21 checks passed
@kjac kjac deleted the v15/bugfix/dont-delete-when-referenced branch February 21, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants