i have a simple module that uses getTagItemsQuery method of JHelperTags class, i have send some parameters to that like $anyOrAll = 1,0 / Ture/false,
i have some articles in my db like : article01(tags : tag1 , tag2) and article02(tags : tag1 , tag3),
if i sent $anyOrAll=true/1 or $anyOrAll=false/0 , returned query is same and a get all articles that have one of sent tags,
i thing $anyOrAll ignored in method and didnot select articles properly,
i check code of that method, i think it needs to review, becouse i use very simple input and result is wrong!
no didn't worked :( after editing that file, i get this results:
i have always any article that has any of tags,
i have upload my simple module that takes this issue in : https://github.com/nasserman/n2articlesbytags.git
Try calling with hardcoded TRUE and FALSE for $includeChildren. One of them should have the HAVING construct to test for exact nr of tags.
If not, than it is either the number of tags or the setting for anyOrAll.
i use to pass true/false value directly, but evry time i get all articles
Probably the difference between $_anyOrAll and $anyOrAll.
Try changing the condition and calling hardcoded TRUE and FALSE.
Haven't seen that method of calling in PHP, suspect it is passing TRUE when calling with parameter $var = $var. Suggest to only use $var.
oh, that is my mistake , but it is not aboute that, now i write some hard codes to pass false values directly to function, but again it returns all articls that have any tag (of selected array).
i fix it, i must send list of tags in format "id,id,id,..." and not ordinary array!! tnx sovainfo (joomla docment is not perfect) , and i have made some update in my module in new repository https://github.com/nasserman/joomla-n2ArticlesByTags
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-01-26 05:57:22 |
Labels |
Added:
?
|
Suggest to replace line 580:
'if ($ntagsr > 1 && $anyOrAll != 1 && $includeChildren != 1)
with
'if ($ntagsr > 1 && $anyOrAll != 1 && $includeChildren == false)