? ? ? ? Pending

User tests: Successful: Unsuccessful:

avatar bembelimen
bembelimen
13 Aug 2018

Pull Request for Issue # .

Summary of Changes

This PR prevents the trashing of workflows/stages when articles are assigned to them

Testing Instructions

Create different stages/workflows and articles assigned to them. Then try to trash the articles

Expected result

Error messages when an article is in the workflow/stage

avatar bembelimen bembelimen - open - 13 Aug 2018
avatar bembelimen bembelimen - change - 13 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 Aug 2018
Category Administration Language & Strings Libraries Front End Plugins
avatar bembelimen bembelimen - change - 13 Aug 2018
Labels Added: ? ?
avatar brianteeman
brianteeman - comment - 13 Aug 2018

unable to test due to 500 error

avatar Quy Quy - change - 14 Aug 2018
Title
Workflow prevent trashing of used stages/workflows
[4.0] Workflow prevent trashing of used stages/workflows
avatar joomla-cms-bot joomla-cms-bot - edited - 14 Aug 2018
avatar brianteeman
brianteeman - comment - 14 Aug 2018

chrome_2018-08-14_12-02-58

avatar wilsonge wilsonge - change - 14 Aug 2018
Labels Added: ?
avatar wilsonge
wilsonge - comment - 14 Aug 2018

Looks like a merge bug? That string shouldn't exist in this branch (because this hasn't been synced since last night and JM only introduced that string with ea4064a today). Either way I just merged 4.0-dev into this PR again so that should be fixed?

avatar bembelimen
bembelimen - comment - 14 Aug 2018

I don't get this String either.

avatar infograf768
infograf768 - comment - 14 Aug 2018

Don't we want lang strings, xml and params to use the wording stages rather than states?

I.e.
instead of
PLG_CONTENT_JOOMLA_FIELD_CHECK_STATES_WORKFLOW_LABEL
use
PLG_CONTENT_JOOMLA_FIELD_CHECK_STAGES_WORKFLOW_LABEL
(same for DESC)

and for
if (!$this->params->def('check_states_workflow', 1))
rather
if (!$this->params->def('check_stages_workflow', 1))

therefore instead of
name="check_states_workflow"
rather
name="check_stages_workflow"

??

avatar infograf768
infograf768 - comment - 14 Aug 2018

I indeed can't delete a stage, but I can delete a condition transition.
Is that expected?

avatar infograf768
infograf768 - comment - 14 Aug 2018

Please see #21571

avatar wilsonge
wilsonge - comment - 14 Aug 2018

Resolved conflicts from that one JM

avatar infograf768
infograf768 - comment - 15 Aug 2018

Remains eventual modification for the field name

if (!$this->params->def('check_states_workflow', 1))
rather
if (!$this->params->def('check_stages_workflow', 1))

therefore instead of
name="check_states_workflow"
rather
name="check_stages_workflow"

@bembelimen ?

avatar wilsonge
wilsonge - comment - 15 Aug 2018

That param needs to be removed to use the component parameter anyhow as per my comment

avatar joomla-cms-bot joomla-cms-bot - change - 18 Aug 2018
Category Administration Language & Strings Libraries Front End Plugins Administration com_content Language & Strings Libraries Front End Plugins
avatar joomla-cms-bot joomla-cms-bot - change - 19 Aug 2018
Category Administration Language & Strings Libraries Front End Plugins com_content Administration com_content com_workflow Language & Strings Libraries Front End Plugins
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2018

Apply PR by Patchtester got The file marked for modification does not exist: libraries/src/Workflow/WorkflowServiceTrait.php

avatar wojsmol
wojsmol - comment - 19 Aug 2018

@franz-wohlkoenig This file also was introduced by #21585

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2018

@wojsmol means not testable in my Environment.

avatar wojsmol
wojsmol - comment - 19 Aug 2018

@franz-wohlkoenig This works on CA but requires manual installation of nightly build zip. This bug should be reported to CA.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2018

the Bug is that Nightly Build used by CA isn't the Nightly Build at https://developer.joomla.org/nightly-builds.html?

avatar wojsmol
wojsmol - comment - 19 Aug 2018

@franz-wohlkoenig I don't know exactly where bug is occurring but as you can see manual install on CA using zip from https://developer.joomla.org/nightly-builds.html is not equal to creating new site on https://launch.joomla.org/.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2018
avatar brianteeman
brianteeman - comment - 20 Aug 2018

I have tested this item ? unsuccessfully on 85223e5

Installed sample data
Changed an article to "archive"
Trashed the stage called "archive"
--- this has no impact on the article even though it is trashed (similar to #21752
Empty the trash - expected behaviour is to get a warning about it being used

Actual behaviour is

Error 0: 0 You can't delete the default item.


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

avatar brianteeman brianteeman - test_item - 20 Aug 2018 - Tested unsuccessfully
avatar bembelimen
bembelimen - comment - 20 Aug 2018

Hello,

is it the "default" stage? Because this will be checked before the number is counted.

avatar brianteeman
brianteeman - comment - 20 Aug 2018

No

avatar bembelimen
bembelimen - comment - 23 Aug 2018

The problem is, that the sample data are not migrated, I guess.

avatar infograf768
infograf768 - comment - 25 Aug 2018

If not done in this PR, it has to go further imho: whether there are or not articles assigned to the default Joomla workflow with its stages and transitions, it should NEVER be modified/trashed/deleted/whatever.

avatar bembelimen
bembelimen - comment - 25 Aug 2018

Why? There is imho no reason to add this restrictions. I think we should not fall back and have the old and the new system implemented but we should look for a modern/better solution... Some user just don't need the default workflow, so why bother them?

avatar alikon
alikon - comment - 25 Aug 2018

sorry to be so direct, but i'm afraid that few users really needs an advanced "workflow" or whatever you call what we have now in staging

avatar infograf768
infograf768 - comment - 25 Aug 2018

Agree with @alikon

Some user just don't need the default workflow, so why bother them?

It would be much more bothering for users who don't need custom workflows.
People needing custom workflows would know what they do and not use the default one, in the same way as we are not forced to use custom fields and totally ignore that feature.

avatar laoneo
laoneo - comment - 25 Aug 2018

You can't compare fields with workflow as it is somwthing on top of an extension. While a workflow is part of the extension.

avatar infograf768
infograf768 - comment - 25 Aug 2018

You can't compare fields with workflow as it is somwthing on top of an extension. While a workflow is part of the extension.

Alas... But in any case it does not make it necessary to allow deletion of the default workflow, used or not.

And to be able to choose a default state/stage (whatever you call it) when using save2copy with a specific parameter.

avatar f-hamel
f-hamel - comment - 8 Sep 2018

I have tested this item ? unsuccessfully on ff70dc6

What I've done:

  • created workflow with transitions and stages
  • created category and assign the new workflow
  • created an article and assign to the category
  • try to trash assigned workflow

expected result:
Can't trash the assigned workflow

actual result:
workflow can be trashed


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

avatar f-hamel f-hamel - test_item - 8 Sep 2018 - Tested unsuccessfully
avatar lavipr
lavipr - comment - 8 Sep 2018

I have tested this item successfully on ff70dc6

testing steps:

  • created new custom workflow
  • created new article
  • used batch-function to assign the created workflow to the new created article
  • tried to delete this workflow

-> Error message appeared: "This item is in use by the component."


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

avatar lavipr lavipr - test_item - 8 Sep 2018 - Tested successfully
avatar bembelimen
bembelimen - comment - 9 Sep 2018

Thanks @f-hamel for this find, could you test again.
@wilsonge I moved the methods, is that ok?

avatar wilsonge
wilsonge - comment - 9 Sep 2018

I'll do another review tomorrow. It's changed a lot since I first reviewed this

avatar f-hamel
f-hamel - comment - 10 Sep 2018

I have tested this item successfully on 10d8bc0

@bembelimen done ;-)


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

avatar f-hamel f-hamel - test_item - 10 Sep 2018 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 10 Sep 2018

@lavipr can you please retest?

avatar lavipr
lavipr - comment - 10 Sep 2018

I have tested this item successfully on 10d8bc0

1. testing steps:
created new custom workflow
created new article
used batch-function to assign the created workflow to the new created article
tried to delete this workflow
-> Error message appeared: "This item is in use by the component."

  1. testing steps:
avatar lavipr lavipr - test_item - 10 Sep 2018 - Tested successfully
avatar franz-wohlkoenig franz-wohlkoenig - change - 10 Sep 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 10 Sep 2018

Ready to Commit after two successful tests. @bembelimen please resolve conflicting Files, thanks.

avatar bembelimen bembelimen - change - 10 Sep 2018
Labels Added: ?
avatar bembelimen
bembelimen - comment - 10 Sep 2018

I resolved the conflict, but let's wait for @wilsonge review

avatar wilsonge wilsonge - change - 11 Dec 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-12-11 00:17:01
Closed_By wilsonge
avatar wilsonge wilsonge - close - 11 Dec 2018
avatar wilsonge wilsonge - merge - 11 Dec 2018
avatar wilsonge
wilsonge - comment - 11 Dec 2018

Thanks :)

Add a Comment

Login with GitHub to post a comment