URL Filtering syntax problem

chris.paschen

Chris Paschen
I have a calc element that generates a link to another list based upon the values in the current list; however, the link seems to have a syntax issue (at least that's what it looks like).

Here's what I've got:
PHP:
  $typename = 'type name';
  $typeid = 3;
 
  $typeInsert = '<a href="http://cmdnet.org/index.php?option=com_fabrik&view=list&listid=63&cmd_yma___component[value][]='. $typeid . '&ItemID=2068">' . $typename . '</a>';
return $typeInsert

In the front-end, the link is being displayed like this (when you put cursor over the link):
Code:
http://cmdnet.org/index.php?option=com_fabrik&view=list&listid=63&cmd_yma___component[value]=3&ItemID=2068
However, the actual link/url is:
Code:
http://cmdnet.org/index.php?option=com_fabrik&view=list&listid=63&cmd_yma___component%5Bvalue%5D%5B%5D=3&ItemID=2068

And clicking on the link results in a lists page with no results.

The 'cmd_yma__component' field is a databasejoin element storing the ID but displaying the name.

There are entries in the list (in the raw database/table) with a 'cmd_yma__component' value of 3, but they are not appearing.

I've tried a number of different 'variations' on the url, including things like this:
PHP:
$typeInsert = '<a href="http://cmdnet.org/index.php?option=com_fabrik&view=list&listid=63&resetfilters=1&cmd_yma___component[value]='. $typeid . '">' . $typename . '</a>';
This resulted in a full list of EVERY entry - no filtering.

I'm guessing that there is just some problem with my syntax here, but after trying at least a couple dozen variations I can't think of any alternatives (I even tried using encoded char for the '[' and ']' - i.e. %5Bvalue%5D - but that didn't change anything).

Anyone have ANY ideas how to get this to work?

NOTE: I'm using the latest github version as of 2/10/15 on Joomla 3.3.6
 
First issue resolved - the 'changing [ and ]'.

The site is running https (ssl) on the entire site. For some reason it doesn't like [ or ] in the URL if using the wrong link.
As soon as I change the http:// to https:// in the direct URL that issue is resolved.

However, still not getting any results.

Which leads me to believe that in the WHERE clause it's trying to match the 'display' value in the databasejoin element from cmd_yma__component.
I've reviewed the fabrikdebug output, but I'm not sure how to deal with these issues (other than to possibly create yet another calc element that just stores the value of the database join element (which would result in redundant data in the table), but I'm really not seeing where this is failing.

Anyone else able to see something that I'm missing?

Here's a link to the individual item - the generated link to the list is in the 'Component' area.
https://cmdnet.org/site-testing-2/yma-test-item
 
I don't think you need the [] syntax or the itemID in this case. Try the following. The "_raw" suffix will match to the dbjoin element's value, without it will match to the label.

PHP:
$typename = 'type name';
$typeid = 3;
 
$typeInsert = '<a href="http://cmdnet.org/index.php?option=com_fabrik&view=list&listid=63&cmd_yma___component_raw='. $typeid . '">' . $typename . '</a>';
return $typeInsert;
 
@rakem
I'm pretty sure I tried that (although I've tried so many things that I'm not sure).
So I tried it again, and still I get no results; however, I noticed something more (although I've noticed this before, but not caught the potential significance).
When the list page is displayed, it shows no results; however, the filtering in the header of the list show that the list is filtered on the proper item.
I also know that there are lots of entries in the table that do match the filter (as can be seen when the filter is removed).

I've tried to figure out where the problem is with the debug, but I'm still not at all good at understanding all the debug data.
I do see LOTS of filter entries - and I'm guessing that is the problem.

If anyone has a minute, you can see the debug results here:
https://cmdnet.org/index.php?option...=1&cmd_yma___component[value]=3&fabrikdebug=1

If you can identify why the table it empty, I'd be VERY thankful.
(OR if you can just help me understand what each of the debug sections are for and how to 'read' them - that would be even better).
 
Try with cmd_yma___component_raw. From the look of the main getData query, that's a join element?

`cmd_yma`.`component` AS `cmd_yma___component_raw`, `cmd_yma_components`.`name` AS `cmd_yma___component`

... so I'm assuming _raw would be the numeric key value, and the non-raw would be the textual name.

-- hugh
 
Using _raw in the fiter yields pages of results for me, dunno if they are the rows you are expecting, though.

Code:
https://cmdnet.org/index.php?option=com_fabrik&view=list&listid=63&resetfilters=1&cmd_yma___component_raw=3&fabrikdebug=1

Not sure what all the warnings are about, although they seem to come from some "eval'ed code" which usually means some custom code you are running somewhere, maybe in a calc?

-- hugh
 
If you aren't seeing anything using that URL, it's possible you have some session data wedged somewhere. Try logging out and back in. Also maybe add clearfilters=1 to the URL, which does ever so slighty different things to resetfilters.

-- hugh
 
hugh

Thanks. Very strange. I changed the url to 'clearfilters' and got nothing, then I changed it back to 'resetfilters' and then it all worked as it should.
I'm guessing something strange with the caching that changing that setting pushed a reset (or I just finally manually refreshed the cache enough that it worked).

I think I'm going to have to build a new custom element for 'categories' that will do what I'm doing with all this custom code.
I think that it would be useful to someone besides me. :)

Thanks again.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top