• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

SOLVED: Prefilter Help

daduts

New Member
Greetings,

Thanks for the help on yesterdays prefilter problem. I'm afraid I have a 2nd one for you.

Here's what my list now looks like....

reglist.jpeg

I have events, account owners(parents) and players(children).

This is the registration list for an event.

In this case....the account owner has 3 players.

2 are registered for the event. The params field includes those 2.

I need to filter this list to filter out the one player who is not registered for the event.

The regselect field includes a unique id for each player.

I've been trying to create a prefilter along the lines of....

params CONTAINS regselect

I've tried various formats based on your Wiki and Forum posts but have not hit a winner yet.

FYI, the raw data in the params field looks like:

{"field1":"Junior(1)","field2":"Max (2)","field3":"0"}

Thanks for your ideas and attention,

Dave
 
ooops, duh, I didn't see the regselect column in the image.

Yes, params contains regselect should do it.

Try enabling Fabrik debug (in the global options), and append &fabrikdebug=1 to your URL (or ?fabrikdebug=1 if it's the first query string arg). Then look at the getData query in the debug output. See what the actual WHERE clause being generated is.

-- hugh
 
Thanks hugh,

I'm still struggling with this one.

Here's what I got....

I've modified my table a little so we are now looking for rows WHERE params CONTAINS regmatch .

I've been playing around with the prefilters and debug mode but have not been able to get the prefilter to produce the query I think I want.

ie... with this pre-filter...

prefilterss.jpeg

I get this Where statement.....

WHERE ( h39rp_jev_attendees.at_id = '57' AND h39rp_jev_attendees.params LIKE '%\'players___regmatch\'%' )


What I think I want is....

WHERE ( h39rp_jev_attendees.at_id = '57' AND h39rp_jev_attendees.params LIKE 'players___regmatch' )

I've tried the various Type's and do not get the desired results.

Still not sure if I've got the wrong query or the wrong prefilter format.

Your thoughts ?

Thanks,

Dave
 
ehhhhh..... not so good

WHERE ( h39rp_jev_attendees.at_id = '57' AND h39rp_jev_attendees.params LIKE %CONCAT(\'%(\', players___regmatch, \')%\')% )

"Error while rendering position" where the table is supposed to be.

Thank you sir, may I have another ?

: D
 
Meh, forgot we'd automagically add those %'s.

I may have to tweak our code so as not to add those, and not to quote the quotes, if you use "no quotes" with a CONTAINS, on the assumption that "I know what I'm doing".

-- hugh
 
PS ... and yes, I know FABRKFILTER_NOQUOTES has a typo ... but that's how it's spelled where we define that constant ... next commit I'll fix all occurrences of it in the code. :)

-- hugh
 
The new noquotes code did the trick and the winning filter ended up being....

condition: contains
value: CONCAT( '%', `players`.`regmatch` , '%' )
type: noquotes

Many thanks,

Cheers,

: D
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top