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

[4.2] [DRAFT] Global Delete Trash - New Feature #27429

Closed
wants to merge 11 commits into from

Conversation

brianteeman
Copy link
Contributor

It has been requested several times that there was a single place where you could go and "empty the trash" for all components.

This new component is based on com_checkin

At this stage
[ ] I am sure the code in the model can be improved
[ ] What should the default permissions be or should it be hard coded restricted to super users only like joomlaupdate is
[ ] To do - add a quickicon on the home dashboard ?

testing

Apply patch and then discover the component
You will then find it in the Maintenance section of the system dashboard

It has been requested several times that there was a single place where you could go and "empty the trash" for all components.

This new component is based on com_checkin

At this stage
[ ] I am sure the code in the model can be improved
[ ] What should the default permissions be or should it be hard coded restricted to super users only like joomlaupdate is

### testing
Apply patch and then discover the component
You will then find it in the Maintenance section of the system dashboard
It has been requested several times that there was a single place where you could go and "empty the trash" for all components.

This new component is based on com_checkin

At this stage
[ ] I am sure the code in the model can be improved
[ ] What should the default permissions be or should it be hard coded restricted to super users only like joomlaupdate is

### testing
Apply patch and then discover the component
You will then find it in the Maintenance section of the system dashboard
@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-4.0-dev labels Jan 7, 2020
@brianteeman brianteeman changed the title [4.0] Global Delete Trash - New Feature [4.0] [DRAFT] Global Delete Trash - New Feature Jan 7, 2020
@jwaisner
Copy link
Member

jwaisner commented Jan 7, 2020

I have tested this item ✅ successfully on a6a6e3b

component functions. trashed objects from all com_ tables. Used component to delete trashed items across the entire site.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27429.

@jwaisner
Copy link
Member

jwaisner commented Jan 7, 2020

I have tested this item ✅ successfully on 96beb04

Everything functions as expected after being added to list as core extension.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27429.

@brianteeman brianteeman mentioned this pull request Jan 7, 2020
@SharkyKZ
Copy link
Contributor

SharkyKZ commented Jan 8, 2020

I'm not sure if com_checkin is a good example. At least if we ever intend to support tables with custom column names. We have some ways of mapping column names to "standard" column names (Joomla\CMS\Table\Table::setColumnAlias() method or the UCM field mappings) but none of that works if we just run through all database tables.

@brianteeman
Copy link
Contributor Author

@SharkyKZ I would suggest that if that ever happens then this code can be updated.

Co-Authored-By: Quy <quy@fluxbb.org>
Copy link
Contributor

@ot2sen ot2sen left a comment

Choose a reason for hiding this comment

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

just some update of year

@brianteeman
Copy link
Contributor Author

@ot2sen no need to update the year. The build scripts will do that

Copy link
Member

@richard67 richard67 left a comment

Choose a reason for hiding this comment

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

PHPCS as reported by Drone

administrator/components/com_trash/Model/TrashModel.php Outdated Show resolved Hide resolved
administrator/components/com_trash/Model/TrashModel.php Outdated Show resolved Hide resolved
administrator/components/com_trash/Model/TrashModel.php Outdated Show resolved Hide resolved
administrator/components/com_trash/Model/TrashModel.php Outdated Show resolved Hide resolved
administrator/components/com_trash/Model/TrashModel.php Outdated Show resolved Hide resolved
@richard67
Copy link
Member

Great new feature ... I think it HAS to go into 4.0 ... so I hope it will be ready before beta.

@brianteeman Is it still draft/WiP? Or is it (beside PHPCS) ready for test? Let us know please when we shall test.

@brianteeman
Copy link
Contributor Author

it is a draft - as in there are bits not done such as install sql AND the questions in the original post. I am confident that the code works just dont know if it is something people think is a good idea etc

@jwaisner
Copy link
Member

I have tested this item ✅ successfully on 292e43e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27429.

@jwaisner
Copy link
Member

@richard67 Can you please give this one a test?

@brianteeman I think it is a good idea. Now how to handle the install SQL is beyond me.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27429.

@richard67
Copy link
Member

@jwaisner As far as I understood @brianteeman this PR is still a draft and not ready. And it is late now here in my time zone and I have to work tomorrow, so right I won't test for sure.

@HLeithner
Copy link
Member

The idea of a global trash is good, but using com_checkin as base is not the best approach. Sharky already mentioned the this component loads all tables and tries to figure out if there is a trash able item or not.

The right way would be that each component has to register for the global trash.

@brianteeman
Copy link
Contributor Author

The right way would be that each component has to register for the global trash.

There is perfect engineering and there is working engineering

@SharkyKZ
Copy link
Contributor

Well, this isn't working. Items should be deleted through the model to make sure all associated data is deleted and proper plugin events are triggered.

@brianteeman
Copy link
Contributor Author

Can you please provide a specific example of where its not working

@SharkyKZ
Copy link
Contributor

Everywhere. None of associated data is deleted because none of the code meant for handling item deletion is being executed this way. Examples of remaining loose data include Asset record (in #__assets table), Language Associations, Custom Fields data, Tag mappings, Content History and 3rd party plugin data.

@brianteeman
Copy link
Contributor Author

forgive me for trying to be constructive and add a requested feature

@SharkyKZ
Copy link
Contributor

You don't need to apologize. It's a good feature but it needs a different approach. I, for one, don't know what that approach would be 😕 .

@brianteeman brianteeman deleted the trash branch May 5, 2021 20:43
@brianteeman brianteeman restored the trash branch May 2, 2022 16:14
@brianteeman brianteeman reopened this May 2, 2022
@brianteeman brianteeman changed the base branch from 4.0-dev to 4.2-dev May 2, 2022 16:16
@brianteeman brianteeman changed the title [4.0] [DRAFT] Global Delete Trash - New Feature [4.2] [DRAFT] Global Delete Trash - New Feature May 2, 2022
@brianteeman brianteeman marked this pull request as draft May 2, 2022 16:18
@brianteeman
Copy link
Contributor Author

re-oponed in draft status as a reminder to myself to work on this

@Quy Quy removed the PR-4.0-dev label May 4, 2022
@brianteeman
Copy link
Contributor Author

Closed - no interest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Change This is for Translators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants