Skip to content
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

Closed
paul-muckypuddle opened this issue Oct 13, 2014 · 7 comments
Closed

Comments

@paul-muckypuddle
Copy link
Contributor

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

@nicksavov
Copy link
Contributor

Thanks Paul! Could you submit a pull request for it? Here's a really easy way how:
http://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests

@paul-muckypuddle
Copy link
Contributor Author

Hi Nick, no problem at all - now done.

@nicksavov
Copy link
Contributor

Thanks Paul!

@zero-24
Copy link
Contributor

zero-24 commented Oct 16, 2014

@nicksavov can you move the PBF label to #4698 ? So we can close here and use the PR for discussion. Thanks

@zero-24
Copy link
Contributor

zero-24 commented Oct 16, 2014

Thanks @nicksavov

@jissues-bot
Copy link

Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/4655

@zero-24
Copy link
Contributor

zero-24 commented Oct 16, 2014

Closing here as we have a PR now thanks @muckypuddle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants