?
avatar ailixter
ailixter
23 Aug 2014

Steps to reproduce the issue

just use 'popular tags' module (mod_tags_popular)

Expected result

no error

Actual result

syntax error in sql - double '

System information (as much as possible)

mysql

Additional comments

redundant quoting in mod_tags_popular/helper.php line 80:

$query->where($db->quoteName('tag_date') . ' > ' . $query->dateAdd($nowDate, '-1', strtoupper($timeframe)));

$nowdate is already quoted at line 36

Votes

# of Users Experiencing Issue
1/2
Average Importance Score
3.50

avatar ailixter ailixter - open - 23 Aug 2014
avatar roland-d
roland-d - comment - 23 Aug 2014

I cannot reproduce this error. The query:

SELECT MAX(`tag_id`) AS tag_id, COUNT(*) AS count,MAX(t.title) AS title,MAX(`t`.`access`) AS access,MAX(`t`.`alias`) AS alias
FROM `jos_contentitem_tag_map` AS `m`
INNER JOIN `jos_tags` AS `t` ON `tag_id` = t.id
INNER JOIN `jos_ucm_content` AS `c` ON `m`.`core_content_id` = `c`.`core_content_id`
WHERE `t`.`access` IN (1,1) AND `t`.`published` = 1  AND `tag_date` > DATE_ADD('2014-08-23 09:25:06', INTERVAL -1 YEAR) AND `m`.`type_alias` = `c`.`core_type_alias` AND `c`.`core_state` = 1 AND (`c`.`core_publish_up` = '0000-00-00 00:00:00' OR `c`.`core_publish_up` <= '2014-08-23 09:25:06') AND (`c`.`core_publish_down` = '0000-00-00 00:00:00' OR  `c`.`core_publish_down` >= '2014-08-23 09:25:06')
GROUP BY `tag_id`,`title`,`access`,`alias`
ORDER BY `count` DESC LIMIT 0, 5

executes fine nor do I see any duplicate quoting.

Line 36 that you mention only has this code:

$nowDate        = JFactory::getDate()->toSql();

The $nowDate is not quoted, the line below with the $nullDate is quoted which is fine since it is not quoted again.

avatar ailixter
ailixter - comment - 23 Aug 2014

line 36: $nowDate = $db->quote(JFactory::getDate()->toSql());

please, find the file attached

(from the distributive:
http://joomlacode.org/gf/download/frsrelease/19665/160049/Joomla_3.3.3-Stable-Full_Package.zip
)

2014-08-23 13:29 GMT+04:00 RolandD notifications@github.com:

I cannot reproduce this error. The query:
... nor do I see any duplicate quoting.

Line 36 that you mention only has this code:

$nowDate = JFactory::getDate()->toSql();

The $nowDate is not quoted, the line below with the $nullDate is quoted
which is fine since it is not quoted again.


Reply to this email directly or view it on GitHub
#4154 (comment).

avatar roland-d
roland-d - comment - 23 Aug 2014

This issue has already been fixed:
69a94cd

so the solution will be in the next release.

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar brianteeman
brianteeman - comment - 23 Aug 2014

Closed

avatar brianteeman brianteeman - change - 23 Aug 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-08-23 12:11:20
avatar brianteeman brianteeman - close - 23 Aug 2014
avatar zero-24 zero-24 - close - 23 Aug 2014
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment