joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[4.0] Fix workflow/stage deletion prevention

Open bembelimen opened this issue 5 years ago • 3 comments

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.

bembelimen avatar Oct 17 '20 01:10 bembelimen

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.

karo3 avatar Oct 17 '20 12:10 karo3

This pull request has automatically rebased to 4.2-dev.

HLeithner avatar Jun 27 '22 13:06 HLeithner

This pull requests has been automatically converted to the PSR-12 coding standard.

joomla-bot avatar Jun 27 '22 21:06 joomla-bot

@bembelimen should we close this because of the great success with this change :-)

rdeutz avatar Oct 21 '22 10:10 rdeutz

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.

bembelimen avatar Oct 21 '22 14:10 bembelimen

Line 559

if (!$this->_canDeleteStage($pk)) {

has to be changed with _workflowNotUsed

chmst avatar Oct 22 '22 09:10 chmst

Thx

bembelimen avatar Oct 22 '22 12:10 bembelimen

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.

drmenzelit avatar Oct 22 '22 12:10 drmenzelit

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.

chmst avatar Oct 22 '22 12:10 chmst

My bad. It should be "in a published"

brianteeman avatar Oct 22 '22 12:10 brianteeman

RTC


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

chmst avatar Oct 23 '22 10:10 chmst