? Success

User tests: Successful: Unsuccessful:

avatar Arpit-24
Arpit-24
6 Apr 2019

Pull Request for Issue #24478 .

Summary of Changes

Add workflow_assosciations entry for the new articles

Testing Instructions

Install sample data
Select all articles
Select batch
Select a category and copy

Expected result

Articles are copied to the selected category

avatar Arpit-24 Arpit-24 - open - 6 Apr 2019
avatar Arpit-24 Arpit-24 - change - 6 Apr 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Apr 2019
Category Administration Templates (admin) Libraries
avatar Arpit-24
Arpit-24 - comment - 6 Apr 2019

Screenshot (1285)

Testing Result

avatar Arpit-24 Arpit-24 - change - 6 Apr 2019
Labels Added: ?
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 7 Apr 2019

I have tested this item 🔴 unsuccessfully on 5528b0e

Article copied successfully, but open a Categorie got Warning: Declaration of Joomla\Component\Categories\Administrator\Model\CategoryModel::batchCopy($value, $pks, $contexts) should be compatible with Joomla\CMS\MVC\Model\AdminModel::batchCopy($value, $workflowid, $pks, $contexts) in /administrator/components/com_categories/Model/CategoryModel.php on line 39

Maybe this Pull Request can not be tested by Patchtester.

System information

Setting Value
PHP Built On Linux lamp122.cloudaccess.net 3.10.0-962.3.2.lve1.5.24.7.el6h.x86_64 nr.1 SMP Mon Dec 17 12:02:35 EST 2018 x86_64
Database Type mysql
Database Version 5.7.24-cll-lve
Database Collation utf8_general_ci
Database Connection Collation utf8_general_ci
PHP Version 7.1.26
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Latest Nightly Build Update from Joomla! 4.0.0-alpha8-dev Development [ Amani ] 9-March-2019 13:41 GMT
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:66.0) Gecko/20100101 Firefox/66.0

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24519.
avatar franz-wohlkoenig franz-wohlkoenig - test_item - 7 Apr 2019 - Tested unsuccessfully
avatar infograf768
infograf768 - comment - 7 Apr 2019

Looks like the problem here is that modifying the Joomla\CMS\MVC\Model\AdminModel::batchCopy by adding $workflowid may be used by another component extending AdminModel, while it concerns only articles.
Therefore categories get warning as well as com_fields. We get errors for contacts, etc.

avatar bembelimen
bembelimen - comment - 7 Apr 2019

If you have the old ID, you don't need this parameter. One can just get the default stage from the workflow (linked in the new category) when copied, so the article is resetted or just don't change anything when moved.

avatar Arpit-24
Arpit-24 - comment - 7 Apr 2019

If you have the old ID, you don't need this parameter. One can just get the default stage from the workflow (linked in the new category) when copied, so the article is resetted or just don't change anything when moved.

Thank you for the help, updated the PR. Now it no longer has the additional param of workflow_id in the function definition.

@franz-wohlkoenig @infograf768 Please re-test

avatar Arpit-24 Arpit-24 - change - 7 Apr 2019
Labels Added: J4 Issue
avatar infograf768
infograf768 - comment - 8 Apr 2019

Please test this:

batch_articles.diff.zip

avatar joomla-cms-bot joomla-cms-bot - change - 8 Apr 2019
Category Administration Templates (admin) Libraries Administration com_content Libraries
avatar joomla-cms-bot joomla-cms-bot - change - 8 Apr 2019
Category Administration Libraries com_content Administration com_content
avatar Arpit-24
Arpit-24 - comment - 8 Apr 2019

Please test this:

batch_articles.diff.zip

Tested to be working locally. Made PR with the changed files.

avatar infograf768
infograf768 - comment - 14 Apr 2019

@bembelimen
is it ok now?

avatar infograf768 infograf768 - change - 14 Apr 2019
Labels Removed: J4 Issue
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Jun 2019
avatar infograf768
infograf768 - comment - 14 Jun 2019

@bembelimen
Please check if it is fine now.
(Still a few code style to correct)

avatar Arpit-24 Arpit-24 - change - 13 Jul 2019
Labels Added: ?
avatar Arpit-24
Arpit-24 - comment - 13 Jul 2019

Made the required changes

avatar Arpit-24 Arpit-24 - change - 20 Aug 2019
Labels Removed: ?
avatar Nilesh5995 Nilesh5995 - test_item - 19 Oct 2019 - Tested successfully
avatar Nilesh5995
Nilesh5995 - comment - 19 Oct 2019

I have tested this item ✅ successfully on 62a78a1

I have tested this item successfully


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

avatar Schmidie64 Schmidie64 - test_item - 19 Oct 2019 - Tested successfully
avatar Schmidie64
Schmidie64 - comment - 19 Oct 2019

I have tested this item ✅ successfully on 62a78a1

Work's as described.


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

avatar pmleconte pmleconte - test_item - 19 Oct 2019 - Tested successfully
avatar pmleconte
pmleconte - comment - 19 Oct 2019

I have tested this item ✅ successfully on 62a78a1


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

avatar pascalelocher pascalelocher - test_item - 19 Oct 2019 - Tested successfully
avatar pascalelocher
pascalelocher - comment - 19 Oct 2019

I have tested this item ✅ successfully on 62a78a1

PHP Version 7.3.8
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 4.0.0-beta1-dev Development [ Amani ] 17-October-2019 20:21 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0


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

avatar adiheutschi adiheutschi - test_item - 19 Oct 2019 - Tested successfully
avatar adiheutschi
adiheutschi - comment - 19 Oct 2019

I have tested this item ✅ successfully on 62a78a1

Success

Setting Value
PHP Built On Linux server2.adiheutschi.ch 3.10.0-962.3.2.lve1.5.24.9.el7.x86_64 #1 SMP Wed Feb 13 08:24:50 EST 2019 x86_64
Database Type mysql
Database Version 10.2.27-MariaDB
Database Collation latin1_swedish_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 7.3.10
Web Server LiteSpeed
WebServer to PHP Interface litespeed
Joomla! Version Joomla! 4.0.0-beta1-dev Development [ Amani ] 17-October-2019 20:21 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36


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

avatar alikon alikon - change - 20 Oct 2019
Status Pending Ready to Commit
avatar alikon
alikon - comment - 20 Oct 2019

RTC


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

avatar infograf768 infograf768 - change - 29 Oct 2019
Labels Added: ?
avatar richard67
richard67 - comment - 29 Oct 2019

I've stumpled over the issue which is fixed by this PR and so found this PR and checked in detail what it does. To be honest: I am not really happy with it.

It overrides the batchCopy routine of the base class with (except of a few codestyle enhancements) identical code just to add then the creation of the workflow association record. This produces duplicate code.

Wouldn't it not be easier just to add following code to routine cleanupPostBatchCopy in the article model below line 92, i.e. after the if with the sql insert of the new record into the #__content_frontpage table (which should also be changed bit that's another issue)?

		// Copy workflow association
		$workflow = new Workflow(['extension' => 'com_content']);
		$assoc = $workflow->getAssociation($oldId);
		$workflow->createAssociation($newId, (int) $assoc->stage_id);

These 3 lines should lead to the same result as this PR does.

Folks, please comment, maybe I am wrong or am missing some aspect of it.

avatar infograf768
infograf768 - comment - 31 Oct 2019

@bembelimen
Please check this and infograf768#55 as we are not sure about handling workflow for this.

avatar Quy Quy - change - 3 Nov 2019
Status Ready to Commit Information Required
avatar richard67
richard67 - comment - 13 Nov 2019

Please test PR #26835 . Is solves the same problem as this PR here, but in a more elegant way.

avatar wilsonge
wilsonge - comment - 13 Nov 2019

Closing in favour of #26835 which uses the API and doesn't require full method duplication

avatar wilsonge wilsonge - change - 13 Nov 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-11-13 12:09:13
Closed_By wilsonge
Labels Removed: ?
avatar wilsonge wilsonge - close - 13 Nov 2019

Add a Comment

Login with GitHub to post a comment