User tests: Successful: Unsuccessful:
Pull Request for Issue #24478 .
Add workflow_assosciations entry for the new articles
Install sample data
Select all articles
Select batch
Select a category and copy
Articles are copied to the selected category
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Templates (admin) Libraries |
Labels |
Added:
?
|
I have tested this item
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.
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 |
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.
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.
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
Labels |
Added:
J4 Issue
|
Please test this:
Category | Administration Templates (admin) Libraries | ⇒ | Administration com_content Libraries |
Category | Administration Libraries com_content | ⇒ | Administration com_content |
Please test this:
Tested to be working locally. Made PR with the changed files.
@bembelimen
is it ok now?
Labels |
Removed:
J4 Issue
|
@yanzhaoINT please test > https://docs.joomla.org/Testing_Joomla!_patches
@bembelimen
Please check if it is fine now.
(Still a few code style to correct)
Labels |
Added:
?
|
Made the required changes
Labels |
Removed:
?
|
I have tested this item
I have tested this item successfully
I have tested this item
Work's as described.
I have tested this item
I have tested this item
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
I have tested this item
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
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
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.
@bembelimen
Please check this and infograf768#55 as we are not sure about handling workflow for this.
Status | Ready to Commit | ⇒ | Information Required |
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-11-13 12:09:13 |
Closed_By | ⇒ | wilsonge | |
Labels |
Removed:
?
|
Testing Result