joomla-cms
joomla-cms copied to clipboard
[4.0] Fix workflow/stage deletion prevention
Summary of Changes
When trying to trash a workflow/stage currently the joomla plugins has a check implemented to prevent the deletion if there are items (articles) assigned.
This checks are broken and should be fixed with this PR
Testing Instructions
Build different scenarios like 2 workflows one assigned to articles, one not. Try to trash both workflows. If successful switch places (first workflow has no items assigned).
Same for stages.
Actual result BEFORE applying this Pull Request
Sometimes you can delete workflow/stages with items assigned. Sometimes you can't trash workflows although no items are assigned.
Expected result AFTER applying this Pull Request
Not possible anymore to trash workflows/stages when articles are assigned.
I have tested this item :red_circle: unsuccessfully on 753a0a6132dc8ecbc5487a17a3b04875d911c412
Inconsistent behavior:
If you mark a stage/workflow that is not in use and not default and one that is default and want to delete both, he deletes one stage If you mark a stage/workflow that is not in use and not default and one that is in use and want to delete both, it does not delete any stage If you mark a stage/workflow that is not in use and not default and one that is default AND is in use and wants to delete both, he deletes one stage
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31120.
This pull request has automatically rebased to 4.2-dev.
This pull requests has been automatically converted to the PSR-12 coding standard.
@bembelimen should we close this because of the great success with this change :-)
I have tested this item red_circle unsuccessfully on 753a0a6Inconsistent behavior:
If you mark a stage/workflow that is not in use and not default and one that is default and want to delete both, he deletes one stage If you mark a stage/workflow that is not in use and not default and one that is in use and want to delete both, it does not delete any stage If you mark a stage/workflow that is not in use and not default and one that is default AND is in use and wants to delete both, he deletes one stage This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31120.
So updated the PR, it should only unpublish/trash/delete anything of all of the selected items have no assignments.
Please test again.
Line 559
if (!$this->_canDeleteStage($pk)) {
has to be changed with _workflowNotUsed
Thx
I have tested this item :white_check_mark: successfully on ecc347894019f79c8fef06f85fbe4dfda5c3bf4c
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31120.
I have tested this item :white_check_mark: successfully on ecc347894019f79c8fef06f85fbe4dfda5c3bf4c
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31120.
My bad. It should be "in a published"
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31120.