User tests: Successful: Unsuccessful:
#3556
J! 3.3 Stable
File : /administrator/components/com_content/models/article.php
For some reasons, it happens that the array
$associations[$item->language] = $item->id;
ends with a null element
Hence,
->where('id IN (' . implode(',', $associations) . ')');
leads to something like "id IN (3188, )"
which gives an error because of the ending comma.
Fix :
after the line :
$associations[$item->language] = $item->id;
add an array_filter :
$associations = array_filter($associations);
Labels |
Labels |
Added:
?
|
Title |
|
There's a PR fixing it already. Just need testers.
On Sunday, May 4, 2014, Nikolai Plath notifications@github.com wrote:
Can't we just "deactivate" Lady Travis for the time she has her ...
hickups https://travis-ci.org/joomla/joomla-cms/builds/24397721? I
believe those failures might confuse new contributors, they might think
that they did something wrong [image: ]—
Reply to this email directly or view it on GitHub#3557 (comment)
.
Could you create a tracker on Joomlacode explaining how to test this and cross referencing.
Status | New | ⇒ | Pending |
Labels |
Removed:
?
|
Labels |
Category | ⇒ | SQL |
This issues is already one year old without any visible progress. There are no testing / replication instructions.
The proposed fix should fix the error but not the cause. Without being able to replicate the bug, it is hard to say if this is the right approach.
Closing the issue and there is not progress and no updates from the OP. Thanks @all.
Status | Pending | ⇒ | Information Required |
The bug is still present in 3.4.1 in File : /administrator/components/com_content/models/article.php
Here is the hack we had to do :
$associations[$item->language] = $item->id;
$associations = array_filter($associations); // Delete the null element that produces the error, otherwise :
// You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
// SQL=DELETE FROM qb4gr_associations WHERE context='com_content.item' AND id IN (4694,)
if ($associations) // Only if $associations, otherwise error :
// You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
// SQL=DELETE FROM qb4gr_associations WHERE context='com_content.item' AND id IN ()
{
// Deleting old association for these items
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->delete('#__associations')
->where('context=' . $db->quote('com_content.item'))
->where('id IN (' . implode(',', $associations) . ')');
$db->setQuery($query);
$db->execute();
if ($error = $db->getErrorMsg())
{
$this->setError($error);
return false;
}
}
I understand that you are still having this issue. But can you provide the steps necessary to replicate this issue on a clean Joomla installation?
This issue will be closed automatically if further information how to replicate this issue is not provided.
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-08-20 18:52:57 |
Closed_By | ⇒ | roland-d |
Closing this issue due to lack of testing instructions and the PR has merge conflicts. Feel free to open the issue anytime when you have test instructions and fixed the merge conflict.
Thank you for your contribution.
Can't we just "deactivate" Lady Travis for the time she has her ... hickups? I believe those failures might confuse new contributors, they might think that they did something wrong