Buy more, save more. Only in 5 days. Take it before it's gone!


JoomlaShine supports and discussions

  1. Forums
  2. General Issues
  3. JoomlaShine Translation
  4. Handling undefined variables in Fabrik Joomla
I have a database join field with a WHERE condition in Fabrik (Joomla). The field gets its content from tableA. The WHERE condition needs one variable from the URL {queryParam}.
This is the WHERE condition:
WHERE EXISTS (SELECT 1 FROM tableB WHERE {thistable}.id = tableB.selected AND tableB.parent_id = {queryParam})
The issue with this is, that query param of course is not always defined which then breaks the whole application since the SQL query is invalid.
I'm not very familiar with Fabrik and Joomla. What would a good practice be to handle this issue? I know, that without query param the SQL query will always return nothing. Is there a way to check if query param is set and If it's not to prevent the SQL query from running?
Or can I set a default for query params (e.g 0, which also will always lead to no results)
I've already looked through the Fabrik wiki, forum, and Joomla posts but couldn't find any useful information.
Environment: Joomla 3.9.4, Fabrik 3.x
You do not have permission to view the content of this accepted answer.
Responses (3)

There are replies in this post but you are not allowed to view the replies from this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.