9 years ago
2
Topic

Hi

I think I have come across a bug, or could you please help me to solve this?

Once again, seblod can do amazing things, but I find myself very frustrated.

I have a simple list type, with two fields. The one is a on / off switch like featured, and the other is a category select multiple. I have set the select multiple to NOT IN in the exclusion settings, but I find the results still contains those categories I am trying to exclude.

I am using live values, and I have also manually appended variables to the URL. I am running it inside a module as well, and it's simply not doing what I want it to do.

At closer inspection, I looked at the query and noticed that the catid is taken from the `#__cck_store_item_content` cck table and not #__content

This is the debug query generated by SEBLOD:

SELECT t0.id as pid, t0.pk as pk, t0.pkb as pkb,t0.cck as cck, t0.storage_location as loc,tt.id AS type_id, tt.alias AS type_alias
FROM `#__cck_core` AS t0
LEFT JOIN `#__cck_store_item_content` AS t1 ON t1.id = t0.pk
LEFT JOIN `#__content` AS t2 ON t2.id = t0.pk
LEFT JOIN `#__cck_core_types` AS tt ON tt.name = t0.cck
WHERE t2.state = 1 AND t2.access IN (1,1,2,3,6) AND ( t2.publish_up = '0000-00-00 00:00:00' OR t2.publish_up <= '2014-06-25 20:41:02' ) AND ( t2.publish_down = '0000-00-00 00:00:00' OR t2.publish_down >= '2014-06-25 20:41:02' ) AND t1.catid NOT IN ('290','754','253','756') AND t0.cck = 'directory' AND t2.restrictions = '1' GROUP BY t0.pk
ORDER BY t2.title ASC

0.034 seconds (0.034); 15.84 MB (15.836) - afterSearch [Cache=OFF] = 118 results.
0.221 seconds (0.186); 18.97 MB (3.135) - afterRender [Cache=OFF]

This is the same query I ran in phpmyadmin, but I changed it as you can see below and it now gives the correct filtered results.

AND t2.catid NOT
IN ( '754', '253', '290', '756' )

SELECT t0.id AS pid, t0.pk AS pk, t0.pkb AS pkb, t0.cck AS cck, t0.storage_location AS loc, tt.id AS type_id, tt.alias AS type_alias, t2.catid AS catid, t2.title AS title
FROM `njg4v_cck_core` AS t0
LEFT JOIN `njg4v_cck_store_item_content` AS t1 ON t1.id = t0.pk
LEFT JOIN `njg4v_content` AS t2 ON t2.id = t0.pk
LEFT JOIN `njg4v_cck_core_types` AS tt ON tt.name = t0.cck
WHERE t2.state =1
AND t2.access
IN ( 1, 1, 2, 3, 6 )
AND (t2.publish_up = '0000-00-00 00:00:00'
OR t2.publish_up <= '2014-06-25 19:58:23' )
AND (t2.publish_down = '0000-00-00 00:00:00'
OR t2.publish_down >= '2014-06-25 19:58:23' )
AND t0.cck = 'directory'
AND t2.catid NOT
IN ( '754', '253', '290', '756' )

AND t2.restrictions = '1'
GROUP BY t0.pk
ORDER BY t2.title ASC
LIMIT 0 , 30


Do you know how I can solve this issue?

Does it have anything to do with using the same listing type more than once on a page? I use it for several modules.

Get a VIP membership
4229 Posts
Kadministrator
9 years ago
0
Level 1

Hi,

please give us exact configuration of your categories field and all fields you have in search tab,

I tried to reproduce this with select dynamic put in article list search type (see configuration here

http://i.share.pho.to/cdf6d01b_o.png - not exactly right as it is giving double results, would need group by, but good enough for testing)

and it works ok for me.

For some reason JForm categories field does not work at all, but judging by descripton you gave this is not related to your problem.

9 years ago
0
Level 1

Hi Kalemanzi,

In order to have what you want, you can define a search type in 2 steps like that:

  1. add 4 fields in the search form like that
  2. click on button "2" to select an appropriate live value/feature for each field
  3. click on button "3" to select an appropriate match operator

Regards,
Mehdi.

Get a Book for SEBLOD