User tests: Successful: Unsuccessful:
Changed 3rd arg of getTypes call to 'true' to lookup types by alias rather than ID (as per docs) (issue #4655)
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
A DB object with items matching those tags, filtered by content type
Error 1064 (MySQl error)
Joomla 3.3.6
PHP 5.3
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
Labels |
Added:
?
|
Labels |
Added:
?
|
Category | ⇒ | Libraries Tags |
Title |
|
Makes sense to change the docs I guess.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-10-16 16:07:26 |
Status | Closed | ⇒ | New |
Whoops... didn't read that big button.
As the issue is with the documentation I am asking that you please update the documentation and I am closing this issue
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4698.
Status | New | ⇒ | Closed |
Set to "closed" on behalf of @brianteeman by The JTracker Application at issues.joomla.org/joomla-cms/4698
Closed_Date | 2014-10-16 16:07:26 | ⇒ | 2014-10-18 15:22:10 |
First of all, I must say that I don't have experience with Tag API (haven't built any extensions use Joomla core tags API yet). However, from a quick look at the code, I think you should correct the documentation instead of correcting the code, the reason is because:
From the code of that method, it is clear that the method expect IDs (integer), not strings.
In TagsModelTag class (Joomla core class), it pass that parameters as array of IDs as well, see the code at
https://github.com/joomla/joomla-cms/blob/staging/components/com_tags/models/tag.php#L196
https://github.com/joomla/joomla-cms/blob/staging/components/com_tags/models/tag.php#L145
So if you fix the code here, you will need to fix the code in TagsModelTag as well.
I might be wrong (as I said, haven't used the API). So if you still want to do this change, maybe we need a developer who has strong experience with Tags API come here and confirm that it works.