Solved Prefilters : eval FabrikHelperElement::filterValue - not working

linque

Member
In a list, I try to use a pre-filter using eval : return FabrikHelperElement::filterValue(20);

I've a error :
Debug: Caught exception on eval of tableModel::getFilterArray() afc_champ_ed.champid: Since joomla/database 2.2.0: The parameter $new is deprecated and will be removed in 4.0, use Joomla\Database\DatabaseDriver::createQuery() instead.

It works in the previus version.
How can I solve it ?
 
Ok...
I don't have the value... :-(
Can I display the value in the Introduction of the list ?
what is the syntax ?
 
In fact, the 'FabrikHelperElement::filterValue(20)' works for my list except if I use the list in a module.
is it normal ?
 
I'm using RSPageBuilder
In my page, I display the list in a row via a 'Fabrik List Module'
In that way, the prefilter with eval of FabrikHelperElement::filterValue(20) is not working.

When a display the list directly from the menu using 'Fabrik -> List', the prefilter with eval of FabrikHelperElement::filterValue(20) is working

more over, I would like to display the value of the filter in the text intro of the list.
 
What is your exact code? Are you using placeholders? Do you have SEF enabled? (Try with SEF off)
 
I have no code and no placeholder, just a list with a filter that I want to use in other list with prefilter.

1712917842101.png
 
A bit a corner case.
If you are using the FabrikHelperElement::filterValue() in a different context (here you are in a "module", the list with the filter is in "component") you must add the context you want to take the filter from.

FabrikHelperElement::filterValue(20,'x_com_fabrik_x')
(replace x with the listID you want to take the filter from).

And make sure to have ResetFilter and ClearFilter =no in menu settings and module settings.

Display in intro:
Fabrik placeholders are defined
https://fabrikar.com/forums/index.php?wiki/placeholders/
you can't use any arbitrary variable.

You can create a custom list template or you can use something like Sourcerer (from Regular Labs).
 
my text introduction is :
1 : {$my->id}
2 : {FabrikHelperElement::filterValue(20,'2_com_fabrik_2')}
3 : {fabrik view=element list=2 rowid=1 element=afc_champ_ed___champid}

my result is :
1 : 906
2 : {FabrikHelperElement::filterValue(20,'2_com_fabrik_2')}
3 : -UAT - test

The FabrikHelperElement is not valued.
Is there a problem with the syntax ?
 
No, as I said, you can't use a function or variable as a placeholder. If you want to display it you must use php code: either in a custom Fabrik template or using something like Sourcerer.

Is you pre-filter working with the context parameter added?
 
My pre-filter works correctly :
1713779378892.png


If I try to follow what you explain :
in the Intro, I add PHP code like that
1713779552581.png


The result is :
1713779602999.png


the code is not executed :-(
 
No, you can't use php code directly in the intro.
As I said: use a custom Fabrik template or using something like Sourcerer.

My pre-filter works correctly :
You said it does not work in a module.
 
Sorry for my english...
I would like to say :
My list (number 3) works correctly using external filter (from list number 2) in pre-filter.
I would like to show the pre-filter I use in the Introduction.

I don't know what is au 'Custom Fabirk Template'
Can you explain or Where can I find documention ?
 
I use Regular Labs Sourcerer in many of my forms intros. It works great and the free version will do what you need to echo the result of the FabrikHelperElement call.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top