1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Add parameter to form url

Discussion in 'Community' started by arnor@icetips.com, Dec 5, 2019.

  1. arnor@icetips.com

    arnor@icetips.com Member

    Level: Community
    Hi guys,

    I have a special situation where I get a parameter in to the list and I need to pass this parameter on to the form. This parameter is part of the pre-filter on the list and I use $_GET to get it there and it works great. Fabrik however seems to use all the pre-filter values to send to the form which is then used in the WHERE clause on the form to get the row from the database. Because this parameter is not part of the form url, the prefilter calculates the incorrect value and it fails. In the Form, the WHERE is constructed like this:

    WHERE vlt_iscm_client_to_do_list.jclient_to_do_list_id = '29'
    AND ((vlt_iscm_client_to_do_list.juser_id = '2010'
    AND vlt_iscm_client_to_do_list.juser_info = '0969e8941357d246a1ccdd2472c2a653'))

    and it's that juser_info hash that is part of the prefilter.

    I've tracked this to a line in form.php:

    // Get pre-filter conditions from table and apply them to the record
    // the false, ignores any filters set by the table
    $where = $listModel->buildQueryWhere(false);

    This adds the prefilters to the WHERE statement. I don't quite understand the need for that as it already has the primary key filter. If I modify this to:

    // AB 2019-12-04: $where = $listModel->buildQueryWhere(false);
    $where = ''; # AB 2019-12-04: Modified line above and this.

    it seems to work fine and the SQL is generated correctly with just the primary key column in the where clause:

    WHERE vlt_iscm_client_to_do_list.jclient_to_do_list_id = '551'

    But I also don't understand why it quotes the value, which is an INT in the database?

    Any way to work around this without modifying this one line?

    Best regards,

Share This Page