?
avatar nasserman
nasserman
24 Jan 2015

Steps to reproduce the issue

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,

Expected result

i thing $anyOrAll ignored in method and didnot select articles properly,

Actual result

System information (as much as possible)

i check code of that method, i think it needs to review, becouse i use very simple input and result is wrong!

Additional comments

avatar nasserman nasserman - open - 24 Jan 2015
avatar sovainfo
sovainfo - comment - 24 Jan 2015

Suggest to replace line 580:
'if ($ntagsr > 1 && $anyOrAll != 1 && $includeChildren != 1)
with
'if ($ntagsr > 1 && $anyOrAll != 1 && $includeChildren == false)

avatar nasserman
nasserman - comment - 24 Jan 2015

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

avatar sovainfo
sovainfo - comment - 24 Jan 2015

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.

avatar nasserman
nasserman - comment - 24 Jan 2015

i use to pass true/false value directly, but evry time i get all articles

avatar sovainfo
sovainfo - comment - 24 Jan 2015

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.

avatar nasserman
nasserman - comment - 24 Jan 2015

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).

avatar nasserman
nasserman - comment - 26 Jan 2015

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

avatar zero-24 zero-24 - close - 26 Jan 2015
avatar nasserman nasserman - change - 26 Jan 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-01-26 05:57:22
avatar nasserman nasserman - close - 26 Jan 2015
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment