[4.0] Fixing Articles batch copy#26835
Conversation
|
article copy to another category don't work, even with non featured article |
|
Yes, just tested: With this PR the error goes away and success message is shown, but then I can't see any copied article. |
|
even if the article is present in the |
|
Yes, in DB they exist, the copied ones have state=0. But then I set filter to show also trashed items I don't see them. |
|
No PHP warning or notice or error, nothing in MySQL log. |
|
almost certainly workflow related. |
|
You can strike through the "almost" I would say. |
|
i was being polite |
|
politically incorrect comment "i hate workflow" 😄 |
|
Question is how we shall coninue with this PR here? It fixes the error "1136 Column count doesn't match value count at row 1" when batch copying a featured article. The general problem we've discovered here, should that be handled in a separate issue? |
We can separate if we merge this fast. Otherwise It can be closed and included in the full patch. |
|
I have tested this item ✅ successfully on 22a19e7 Other problems with batch processing are out of scope of this PR. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26835. |
|
Modified title to fit. |
|
@alikon My query shows an additional condition:
Could this one be the problem? Unfortunately we don't see values of prepared statements in debug. |
| $query = $db->getQuery(true) | ||
| ->insert($db->quoteName('#__content_frontpage')) | ||
| ->values($newId . ', 0'); | ||
| ->values($newId . ', 0, NULL, NULL'); |
There was a problem hiding this comment.
These should be dates from copied article.
There was a problem hiding this comment.
Not sure. Dates have to fit to copied state. If featured flag is reset, too, and status, then also these have to be reset. It needs to check what the '0' nefore these values is, but I don't see the columns list here.
There was a problem hiding this comment.
@alikon Check the file ... an insert without a columns list ... that's a kind of lotto play. Am I right, or do I miss something?
There was a problem hiding this comment.
@alikon When i do an insert statement, i have a columns list, so it reads "INSERT INTO blabla_table (col1, col2, col3) VALUES (1,2,3);". Here in this statement I don't see that columns list, only something wihc result in "INSERT INTO blabla_table VALUES (1,2,3);"
There was a problem hiding this comment.
Legit but not safe in case of schema changes
There was a problem hiding this comment.
that's another story... you'll allways have to do things carefully when a schema change happen, even with the full column name syntax...
There was a problem hiding this comment.
@SharkyKZ I think you are right, but for this I think it needs to move up lines 96 $oldItem = $this->getTable(); and 97 $oldItem->load($oldId); up to before the insert statement, right? The load routine of that table btw. is the one which I thought I could remove with PR #26829 , good that I haven't done this. It loads the featured up and down times from the content frontpage table and copies them into the article table. These then should be used here instead of the NULLs. Please confirm if that would be the right way.
@infograf768 If that is right, should I make a PR against your branch to save you some work, so you just can merge it into this PR?
There was a problem hiding this comment.
hmm... Looks like you are right.
There was a problem hiding this comment.
I have it here, Shall I make PR for you, @infograf768 . Is not as complicated as I wrote above. But it will not solve our other, more general problem, only will make the times being copied right.
|
AFAIK com_content has not been converted to prepared statement.... maybe some MVC libraries... |
|
@infograf768 Please check infograf768#54. It implements @SharkyKZ 's comment that the dates of the copied article shall be used. Unfortunately it does not solve the other, more global problem. |
|
@richard67 See my comment in your PR |
|
I have tested this item 🔴 unsuccessfully on 22a19e7 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26835. |
[4.0] Use featured up and down times from copied article, if set
|
@anibalsanchez Solving fully batch copy will require another PR. |
|
@anibalsanchez Please test again with respect to the comment in my previous test result above:
|
|
@infograf768 As @wilsonge commented here infograf768#55 (comment), my PR infograf768#55 seems to be ok. Do you want to merge it into this PR so it can be tested? |
|
even if, apart wilsonge thinking, |
|
I haven’t tested it but if it works it’s definitely the better fix to use the post install cleanup and the built in library |
|
Post install cleanup? |
|
How is the post install cleanup related to this here? |
|
I meant the |
|
Ah now I understand. |
|
Was confused because there is also a cleanup of post install messages issue ;-) |
|
Where do we stand here? |
|
@infograf768 As said above: Merge my PR for you, change title and description of this PR here so it‘s clear that it solves the issue with batch copying articles in general, also if not featured, then refer to this PR here in Brian‘s issue and finally wait for testers. |
…-workflow-assocs [4.0] Batch copy workflow association, too
|
@richard67 |
|
@infograf768 Now it needs to change title and description of this PR so it is clear that it solves the issue with batch copying articles in general, also if not featured. I can't do this for you now because am at work. I'll leave a reference to this PR in Brian's issue. |
|
I have tested this item ✅ successfully on fc0d70a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26835. |
1 similar comment
|
I have tested this item ✅ successfully on fc0d70a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26835. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26835. |
|
Thanks! |

Summary of Changes
Adapting code to the new columns featured_up and featured_down
Testing Instructions
Select a featured or a non-featured article and batch copy it to another category.
Before patch
Fails
After patch
All is fine
Documentation Changes Required