PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar weeblr
weeblr
25 Feb 2025

Pull Request for Issue #37351

Summary of Changes

Second attempt at fixing #37351.

Previous PR (#38810) was reverted (in #41790) because it would not work if Workflow was enabled.

This super simple PR checks if workflows are enabled and if so set a transition value of 1. If workflows not enabled, it sets state to 0, as in #38810.

Testing Instructions

  1. Save an article as a copy. The new copy is directly published.
  2. Apply patch.
  3. Save an article as a copy. The new copy is unpublished.

Repeat 1-3 with Workflow enabled and disabled (System -> Global Configuration -> Articles -> Integrations -> Workflow.

Result should be the same.

avatar weeblr weeblr - open - 25 Feb 2025
avatar weeblr weeblr - change - 25 Feb 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 25 Feb 2025
Category Administration com_content
avatar QuyTon QuyTon - change - 25 Feb 2025
Labels Added: PR-5.3-dev
avatar brianteeman
brianteeman - comment - 25 Feb 2025

Much as I hate to say add an option for this changed behaviour in this case I think it is necessary as the behaviour has been not to unpublish for such a long time (even if that was a bug) that it would be a disruptive change in expected behaviour

avatar weeblr
weeblr - comment - 25 Feb 2025

Hi

I'd be with @crystalenka here (#38810 (comment)) and say that this change reverts to a "safe" behavior, hence I don't see the need for a setting.

When this was changed from "unpublish on copy" to "keep published on copy", it may have needed a setting, as the change was disruptive and would cause invalid content to be published.

None was added at the time.

Going back means at worst the article is not going to be published. But that would hardly go unnoticed as I'd expect "Save copy" was done on purpose, to modify the original content.

So I'd vote to keep it simple and jsut revert to the safe behavior.

avatar richard67
richard67 - comment - 25 Feb 2025

@weeblr Could you check the log of the PHPCS check here https://ci.joomla.org/joomla/joomla-cms/82592/1/7 ? It reports a syntax error.

avatar weeblr
weeblr - comment - 25 Feb 2025

Sorry, fixed now.

avatar richard67
richard67 - comment - 25 Feb 2025

Sorry, fixed now.

@weeblr No need for sorry, it can happen to the best. Thanks for contributing.

avatar AndySDH AndySDH - test_item - 25 Feb 2025 - Tested successfully
avatar viocassel viocassel - test_item - 25 Feb 2025 - Tested successfully
avatar viocassel
viocassel - comment - 25 Feb 2025

I have tested this item ✅ successfully on dc24644


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

avatar alikon alikon - change - 25 Feb 2025
The description was changed
Status Pending Ready to Commit
avatar alikon
alikon - comment - 25 Feb 2025

RTC


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

avatar joomla-cms-bot joomla-cms-bot - edited - 25 Feb 2025
avatar brianteeman brianteeman - test_item - 25 Feb 2025 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 25 Feb 2025

I have tested this item 🔴 unsuccessfully on dc24644


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

avatar brianteeman
brianteeman - comment - 25 Feb 2025
chrome_gui5xWudwZ.mp4

opened an article for editing
saved as copy
status did not change it was still published

avatar fgsw fgsw - test_item - 26 Feb 2025 - Tested unsuccessfully
avatar fgsw
fgsw - comment - 26 Feb 2025

I have tested this item 🔴 unsuccessfully on dc24644

Without pull request

  • Disabled workflow: Save as Copy give status "Published"
  • Enabled workflow: Save as Copy give status "Unpublished"

With pull request

Same as without pull request.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45014.
avatar alikon alikon - change - 26 Feb 2025
Status Ready to Commit Pending
avatar weeblr
weeblr - comment - 26 Feb 2025

@brianteeman @fgsw Which Joomla version are you testing this on?

avatar weeblr
weeblr - comment - 26 Feb 2025

@brianteeman @fgsw Forget my last question, I did a quick change late yesterday and used the wrong variable name. I have fixed that now.

avatar brianteeman brianteeman - test_item - 26 Feb 2025 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 26 Feb 2025

I have tested this item 🔴 unsuccessfully on 16e2056


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

avatar brianteeman
brianteeman - comment - 26 Feb 2025

This does now work for non-workflow content.

However for workflow content it is hard coded that transition 1 is unpublished. So it works for the default workflow but fails for any other (such as the blog workflow from the sample data)

image

avatar fgsw
fgsw - comment - 26 Feb 2025

Which Joomla version are you testing this on?

I use the prebuilt package custom update server.

avatar weeblr
weeblr - comment - 26 Feb 2025

However for workflow content it is hard coded that transition 1 is unpublished. So it works for the default workflow but fails for any other (such as the blog workflow from the sample data)

Suspected there'd be something like that coming up. In essence, we should not set to unpublish but to the starting stage I guess.

Starting to be tricky and requires much more work. Maybe the thing to do at this stage is to only unpublish if workflow is not enabled and be done with it.

avatar brianteeman
brianteeman - comment - 26 Feb 2025

However for workflow content it is hard coded that transition 1 is unpublished. So it works for the default workflow but fails for any other (such as the blog workflow from the sample data)

Suspected there'd be something like that coming up. In essence, we should not set to unpublish but to the starting stage I guess.

Starting to be tricky and requires much more work. Maybe the thing to do at this stage is to only unpublish if workflow is not enabled and be done with it.

that would be my preference together with completely removing workflow

avatar weeblr
weeblr - comment - 26 Feb 2025

with completely removing workflow

from the CMS ?

avatar brianteeman
brianteeman - comment - 26 Feb 2025

with completely removing workflow

from the CMS ?

yes

avatar weeblr
weeblr - comment - 26 Feb 2025

Well, won't comment on that.

For now I have found that I can easily revert to Basic stage by setting the transition to an empty string instead of the hardcode 1. This works for me with the Blog sample data, workflow enabled or not.

Add a Comment

Login with GitHub to post a comment