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

Fix EZP-22628: Children containing ezuser can not be trashed #936

Merged
merged 1 commit into from Apr 23, 2014

Conversation

yannickroger
Copy link
Contributor

Link: https://jira.ez.no/browse/EZP-22628

Description

Object containing ezuser attribute can not be sent to trash. It has been the case for a while (and for 10 years for the user class).
If you delete the parent of one of these object (and the parent don't have an ezuser field) ezpublish will try to send it to trash and this will trigger side effects. A quick example is to delete a user_group containing users.

This patch modifies slightly the behavior:

  • The "move to trash" checkbox will always be present. If a subtree item contains an ezuser attribute, it will be deactivated and an explanation message will be present (only if needed).
  • Children will also be checked to decide if a tree can be sent to trash. If one wants to trash a tree containing ezusers, they will need to go delete them first.

Screenshot

delete_user

Tests

Manual sanity check on content deletion.

TODO

  • Translations ?

@lolautruche
Copy link
Contributor

+1

1 similar comment
@andrerom
Copy link
Contributor

+1

@yannickroger
Copy link
Contributor Author

In your opinion what should be done regarding translation, especially if this fix is backported ?

@bdunogier
Copy link
Member

I'd have phrased a bit differently: "Objects containing ezuser attributes can not be sent to trash".

And technically, it doesn't apply to "objects containing ezuser attributes", but to User objects... since they have to be declared as such in the settings. "User objects can't be sent to trash" would do.

<input type="checkbox" name="MoveToTrash" value="1"
{if and($move_to_trash, $move_to_trash_allowed) }checked="checked" {/if}
{if not($move_to_trash_allowed)}disabled="disabled" {/if}
title="{'If "Move to trash" is checked, the items will be moved to the trash instead of being permanently deleted.'|i18n( 'design/admin/node/removeobject' )|wash}"
Copy link
Member

Choose a reason for hiding this comment

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

If "Move to trash" is checked, the items will be moved to the trash instead of being permanently deleted.
"If checked, items will be moved to trash instead of being permanently deleted." ? (shorter)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one is the original text so I did not change it.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, okay. Nevermind then.

@bdunogier
Copy link
Member

+1

@yannickroger
Copy link
Contributor Author

Thanks for the feedback @bdunogier it has been taking care of.
Open for final review.

@andrerom
Copy link
Contributor

Also take note of the related PR #939

yannickroger added a commit that referenced this pull request Apr 23, 2014
Fix EZP-22628: Children containing ezuser can not be trashed
@yannickroger yannickroger merged commit 312dda9 into master Apr 23, 2014
@yannickroger yannickroger deleted the ezp-22628-trash_user branch April 23, 2014 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants