? Pending

User tests: Successful: Unsuccessful:

avatar ggppdk
ggppdk
15 Aug 2018

[Workflow] Restore tasks:

  • publish, unpublish, archive, trash
    to AdminController for extensions using workflow

and re-add them to backend articles manager)

Pull Request for Issue #21527

Summary of Changes

All tasks are mapped to 'publish' of AdminController,
make AdminController aware of workflow transitions
by checking if a model extension implements 'runTransition()' Method
and the run the correspoding "from-any-stage" transitions

Testing Instructions

Go to article manager select some articles and use Toolbar buttons

publish, unpublish, archive, trash

After / if this tested / merged
#21585

Then we may also improve transition selection in the controller

Expected result

Buttons are in the toolbar and they work

Actual result

Buttons were removed from the toolbar

Documentation Changes Required

avatar ggppdk ggppdk - open - 15 Aug 2018
avatar ggppdk ggppdk - change - 15 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Aug 2018
Category Administration com_content Libraries
avatar ggppdk
ggppdk - comment - 15 Aug 2018

Please wait to remove the testing code ...

avatar joomla-cms-bot joomla-cms-bot - edited - 15 Aug 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 15 Aug 2018
Title
[Workflow] Restore publish, unpublish, archive, trash tasks to AdminController (and readd them to backend articles manager) for extensions using workflow
[4.0] [Workflow] Restore publish, unpublish, archive, trash tasks to AdminController (and readd them to backend articles manager) for extensions using workflow
avatar ggppdk ggppdk - change - 15 Aug 2018
The description was changed
avatar ggppdk ggppdk - edited - 15 Aug 2018
avatar ggppdk ggppdk - change - 15 Aug 2018
Labels Added: ?
avatar ggppdk ggppdk - change - 15 Aug 2018
Title
[4.0] [Workflow] Restore publish, unpublish, archive, trash tasks to AdminController (and readd them to backend articles manager) for extensions using workflow
[4.0] [Workflow] Restore publish, unpublish, archive, trash tasks to AdminController for extensions using workflow (and readd them to backend articles manager)
avatar ggppdk ggppdk - edited - 15 Aug 2018
avatar ggppdk ggppdk - change - 15 Aug 2018
The description was changed
avatar ggppdk ggppdk - edited - 15 Aug 2018
avatar wilsonge
wilsonge - comment - 15 Aug 2018

What happens when a transition doesn't exist? For example many workflows are not going to have an archived state I'd imagine...

avatar brianteeman
brianteeman - comment - 15 Aug 2018

Shouldn't we be checking the existence of the state and the ACL before displaying each button?

avatar ggppdk
ggppdk - comment - 15 Aug 2018

What happens when a transition doesn't exist? For example many workflows are not going to have an archived state I'd imagine...

You are asking exactly what i was going to comment about

  • the creation of the task buttons ... must be made automatic from the existing workflow configuration
  • this work is incomplete

See my comment in the code

(Future) query DB table #__workflow_transitions (or use API) to get (e.g. transition) [from_stage_id: -1 , condition: ContentComponent::CONDITION_PUBLISHED]

Plus there should be a new task into the AdminController for extensions using workflow, that should handle all custom transitions

It makes sense to add 1 new task button (change state) for every workflow transition from stage -1 (aka (from any stage) this way to avoid having task buttons that are not applicable for all rows

avatar ggppdk
ggppdk - comment - 15 Aug 2018

In short this is a band-aid to get old workflow working until we have a more complete solution

avatar HLeithner
HLeithner - comment - 15 Aug 2018

It's not so simple.
We have to find a transition for each "article" the user is allowed to use that bring the "article" to the condition s/he like. This is planned to be implemented after #21585 is merged (drone hates me).

avatar ggppdk
ggppdk - comment - 15 Aug 2018

@HLeithner

yes
and if you have time to do this work in the short term future , then i can close this, since as said above it is a quick fix, i made in 1 hours work to get the old task buttons back
and we can skip testing / using this completely

avatar bembelimen
bembelimen - comment - 15 Aug 2018

In my opinion they still should not be any publish/unpublish/trash button anymore, because that is not the way it works. You don't trash articles from everywhere.

There is a more sensitive solution required.

We have some ideas to bring the buttons back in a better fitting way.

avatar ggppdk
ggppdk - comment - 15 Aug 2018

@bembelimen

they still should not be any publish/unpublish/trash button anymore, because that is not the way it works. You don't trash articles from everywhere.

i understand what you are saying,

but we need to think of the most common case scenario
which would be hide that

  • the workflow UI is hidden (despite workflow code always being active)
  • and the user is presented with the most common scenario of "basic" workflow which will means what we had before workflow was added (aka these buttons too)

i mean we do not want to force workflow UI on all websites when most of them will not need it
plus it will make Joomla look more complex out of the box

We have some ideas to bring the buttons back in a better fitting way.

yes something like adding configuration to mark a transition to appear or not as toolbar button
then i ll close this for now

avatar ggppdk ggppdk - change - 15 Aug 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-08-15 16:24:23
Closed_By ggppdk
avatar ggppdk ggppdk - close - 15 Aug 2018

Add a Comment

Login with GitHub to post a comment