-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Fix batch copy for articles #24519
Conversation
Hides the header and options in full screen mode to prevent overlap over the editor area in full-screen mode. Another possible alternative is displaying both the options as well as the editor in full-screen mode but purely a user preference. Because the need for save and other options is not as important in full-screen mode.
I have tested this item 🔴 unsuccessfully on 5528b0e Maybe this Pull Request can not be tested by Patchtester. System information
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24519. |
Looks like the problem here is that modifying the |
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 |
->where($db->quoteName('item_id') . ' = ' . $pk); | ||
$db->setQuery($query); | ||
|
||
$results = $db->loadObjectList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->loadObject()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the required changes
$query->clear() | ||
->insert($db->quoteName('#__workflow_associations')) | ||
->columns(array($db->quoteName('item_id'), $db->quoteName('stage_id'), $db->quoteName('extension'))) | ||
->values($newId . ', ' . $old_stage_id . ', \'' . $oldExtension . '\''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->quote(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this actually gives error in my PC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->values($db->quote($newId) . ',' . $db->quote($old_stage_id) . ',' . $db->quote($oldExtension));
does it here. See my zip below.
$query = $db->getQuery(true) | ||
->select($db->quoteName(array('stage_id','extension'))) | ||
->from($db->quoteName('#__workflow_associations')) | ||
->where($db->quoteName('item_id') . ' = ' . $pk); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing context/extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid I don't understand what you mean
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add this changes here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bembelimen
In fact, is indeed missing a ending return for this file in core.
Co-Authored-By: Quy <quy@fluxbb.org>
Co-Authored-By: Quy <quy@fluxbb.org>
Co-Authored-By: Quy <quy@fluxbb.org>
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. |
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. |
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. |
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. |
I have tested this item ✅ successfully on 62a78a1 Setting Value This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24519. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24519. |
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
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 test PR #26835 . Is solves the same problem as this PR here, but in a more elegant way. |
Closing in favour of #26835 which uses the API and doesn't require full method duplication |
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