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

[5.2] fix orphan components through trash #45099

Open
wants to merge 8 commits into
base: 5.2-dev
Choose a base branch
from

Conversation

reem-atalah
Copy link

@reem-atalah reem-atalah commented Mar 8, 2025

Pull Request for Issue #45026.

Summary of Changes

Add a new button called Trash in the Actions dropdown list on the Users page when selecting a user and clicking on it, the user is soft deleted.

Testing Instructions

Go to Users -> Create New User
(
Go to Articles -> Create New Article
Go to the Publishing tab -> Set the Created By to the new user
Go to Users -> Select the new user -> Click on Actions dropdown list -> Click on Trash

or

Login with the new user
Go to Articles -> Create New Article
Logout and login again with an administrator user
Go to Users -> Select the new user -> Click on Actions dropdown list -> Click on Trash
)

Go to the article where the Create By is the deleted user, edit and save it, it will be saved normally.

Actual result BEFORE applying this Pull Request

Deleting a user from the system will mean you have 'orphan' articles, categories, and other items within Joomla, so you can no longer edit those records, unless the create by is changed.

Expected result AFTER applying this Pull Request

Deleting a user from the system using the Trash button will soft delete the user where the user won't appear in the users' list, and we can't log in with that user. However we can edit contents created by this user.
Note: the Delete button still exists.

freecompress-joomla.trash.user.mp4

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-5.2-dev labels Mar 8, 2025
@reem-atalah
Copy link
Author

Hello all,
I have read the history links attached to the issue.
I can see that the last update is this comment, my POC is to trash/archive a user instead of deleting, i.e. similar to putting articles in the trash, I need to put the user in the trash, the user in the trash should have no privileges at all ( act as deleted, but the user's record exists), then when the user enters the trash, he can delete the user, but give him a warning that this can cause side effects.
But I'm confused somehow of how to implement this, as it's a new feature rather than updating an existing one.
Appreciate your guidance.

@chmst
Copy link
Contributor

chmst commented Mar 12, 2025

Thank you for working on that problem.
It is an interesting approach but

  1. This is a feature, please make the PR for the 6.0 branch (the simple way is to close this PR and start new).
  2. Describe your intention in the form (Summary of Changes)
  3. Write good test instructions, so that people know how they can test.
  4. This is a new behaviour and - if accepted - needs decumentation.

Then maintainers and users will say their opinion.

@chmst chmst added the Feature label Mar 12, 2025
@Hackwar
Copy link
Member

Hackwar commented Mar 12, 2025

I can already tell you, that users are not trashable. Besides the outwards appearance that people are never trash, the whole concept of trashing an item does not apply to users.

@reem-atalah
Copy link
Author

@Hackwar Hmm, ok, then can I use the concept of archive?
I mean I need to keep the user record in DB, but with no privileges

@chmst
Copy link
Contributor

chmst commented Mar 12, 2025

Users cannot be "trashed" but I think it is a good attempt to keep the id and anonymise data.
Then these records do not represent users - they cannot login and do not have any rights.

@reem-atalah
Copy link
Author

reem-atalah commented Mar 12, 2025

Ok then I can make a soft delete as a first step, and then we can filter on "Deleted" users, so we can delete them again permanently, or just have a soft delete?

@chmst
Copy link
Contributor

chmst commented Mar 12, 2025

I'd say first step is anonymising data and adding a filter (my personal opinion / expectation)
But be aware that this is one of these PRs where you get 10 answers if you ask 5 people. I see it as a valuable proof of concept, where many questions and many expectations remain unsanswered

@reem-atalah reem-atalah changed the title [5.2] fix orphan components [5.2] fix orphan components through trash Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants