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
getTagItemsQuery documentation incorrect, arguments causes SQL error #4655
Comments
Thanks Paul! Could you submit a pull request for it? Here's a really easy way how: |
Hi Nick, no problem at all - now done. |
Thanks Paul! |
@nicksavov can you move the PBF label to #4698 ? So we can close here and use the PR for discussion. Thanks |
Thanks @nicksavov |
Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/4655 |
Closing here as we have a PR now thanks @muckypuddle |
Steps to reproduce the issue
1 - Call JHelperTags getTagItemsQuery method with the 2nd argument containing an array of type aliases (as perhttp://api.joomla.org/cms-3/classes/JHelperTags.html#method_getTagItemsQuery
Expected result
A DB object with items matching those tags, filtered by content type
Actual result
Error 1064 (MySQl error)
System information (as much as possible)
Joomla 3.3.6
PHP 5.3
Additional comments
The fix is fairly simple. getTagItemsQuery documentation says it expects the 2nd argument to be an array of content type aliases, a single alias, or null. In fact, because line 560 of JHelperTags calls self::getTypes('assocList', $typesr, false); with the 3rd param as 'false' it actually expects content type IDs, not aliases. Thus, the query causes an error. Changing this to true, or supplying getTagItemsQuery with type IDs, does not cause the issue
The text was updated successfully, but these errors were encountered: