?
avatar mrkale
mrkale
15 Apr 2016

Steps to reproduce the issue

Implement batch untagging function in a custom component. However, the simplest way is to look into the source code. The bug is on the code line 1056 in the file \\libraries\cms\helper\tags.php. The argument(s) of the SQL clause IN should be enclosed in braces.

Expected result

Without SQL syntax error at batch untagging in a component.

Actual result

The bug leads to the error message:

1064 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 '2' at line 3 SQL=DELETE FROM #__contentitem_tag_map WHERE `type_alias` = 'com_gfamily.domain' AND `content_item_id` = 2 AND tag_id IN 2

System information (as much as possible)

The line 1056 of the file \\libraries\cms\helper\tags.php is currently
$query->where($db->quoteName('tag_id') . ' IN ' . implode(',', $tags));

and should be
$query->where($db->quoteName('tag_id') . ' IN (' . implode(',', $tags) . ')');

Additional comments

The bug is present in the JoomlaCMS since version 3.4 (maybe sooner or since introducing tagging capabality) and persists in the version 3.5.1 as well.

avatar mrkale mrkale - open - 15 Apr 2016
avatar brianteeman brianteeman - change - 15 Apr 2016
Category SQL Tags
avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Apr 2016
avatar mrkale
mrkale - comment - 15 Apr 2016

OK, past the weekend.

Bye, mrkale.

On Fri, Apr 15, 2016 at 11:35 AM, andrepereiradasilva <
notifications@github.com> wrote:

@mrkale https://github.com/mrkale can you do a Pull Request (PR) to
correct that?

https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/helper/tags.php#L1056


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#9926 (comment)

avatar richard67
richard67 - comment - 16 Apr 2016

I think this caqn be closed since there is a PR for that: #9946


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

avatar brianteeman brianteeman - close - 16 Apr 2016
avatar brianteeman brianteeman - close - 16 Apr 2016
avatar brianteeman brianteeman - change - 16 Apr 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-04-16 16:55:30
Closed_By brianteeman
avatar brianteeman brianteeman - change - 22 Apr 2016
Labels Added: ?

Add a Comment

Login with GitHub to post a comment