darkhoros VIP
Total posts: 152
24 May 2016 20:14

Hi, I am trying to Create pre-filtered links using multi select field,

as instructions and docs says, I got the field key and constructed the following url link

http://{siteurl}/index.php?option=com_cobalt&task=records.filter&section_id=4&Itemid=101&&filter_name[0]=filter_k71b951921f2e6b4d9251970006010b83&filter_val[0]=mivida

The problem is it is not working and rather giving me error

If difficulties persist, please contact the System Administrator of this site and report the error below.

1054 Unknown column 'mivida' in 'where clause' SQL=SELECT parent.id FROM xepf7_js_res_field_multilevelselect AS c, xepf7_js_res_field_multilevelselect AS parent WHERE c.lft BETWEEN parent.lft AND parent.rgt AND c.id = mivida AND parent.field_id = c.field_id ORDER BY parent.lft ASC 


The word mivida in the error is thee filter_val, I am not sure why is it trying to use it as a column value, there may be a bug with the filtering system, anyway I hope some one can shade some light for me on this issue.

Thank you.

Last Modified: 05 Jun 2016


darkhoros VIP
Total posts: 152
24 May 2016 20:33

Hi, I just got it working, reading more in to the docs I found that field value may be single or an array, so I tried to use an array setup and it worked, now my URL looks like this

http://{siteurl}/index.php?option=com_cobalt&task=records.filter&section_id=4&Itemid=101&&filter_name[0]=filter_k71b951921f2e6b4d9251970006010b83&filter_val[0][]=mivida

Thank you all, I hope this saves some one time.


darkhoros VIP
Total posts: 152
24 May 2016 20:45

Hi, I think it is just not over yet, the error is gone but the filter is not working, the page loads with no errors but filter is not applied. I may be missing some thing else, I hope some one can look at it.

Thank you.


Jeff VIP
Total posts: 745
25 May 2016 07:08

Have you tried replacing Itemid=101&& with Itemid=101& ?


darkhoros VIP
Total posts: 152
25 May 2016 08:30

Hi, Yes, I have noticed that typo and fixed it, but same result, filters not applied. I hope sergy or peper may have input on this. Thank you.


Sergey
Total posts: 13,748
25 May 2016 08:37

The problem might be because of filter mode. If you do not allow to show articles in section root or filter in category and node, nothing ever shown in section root. You do not use category, so you have to be sure that in section root you have articles and filter block.


darkhoros VIP
Total posts: 152
25 May 2016 10:41

Hi sergey, Thank you for your input, I have records in category, the problem is based on your inout, it should return empty page with nothing found matching your filter, but it is displaying records as if no filters is made.

You suggest that I add category filter to my URL link?

Please clearfy.

Thank you for your time. Regards.


darkhoros VIP
Total posts: 152
25 May 2016 19:49

Hi, For this to work with multi-select field, I found that I have to use the ID of the multi-select value I like to filter, this can be found at the phpmyadmin at the multiselect table.

Thank you.


pepperstreet VIP
Total posts: 3,837
26 May 2016 23:58

darkhoros Thank you all, I hope this saves some one time. ... For this to work with multi-select field, I found that I have to use the ID of the multi-select value I like to filter, this can be found at the phpmyadmin at the multiselect table. Thank you.

Thanks goes to YOU! Appreciate sharing your experiences and hints. Might come in handy at a later date.


Sergey
Total posts: 13,748
05 Jun 2016 14:15

So you use Multi LEVEL select not multiselect. Those are different. In multiselect index is not important since values are not stored in DB. But in Multi LEVEL select it is important.

Powered by Cobalt