1. Fabrik 3.8.1 has been released. It is mostly bug fixes and feature enhancements, but does include two new plugins (push notifications, and the sequence element). As usual we strongly recommend testing the new release on a sandbox if your application is mission critical, and always do an Akeeba backup before updating.

List Pre-filters and F3.8

Discussion in 'Community' started by stevelis, Feb 10, 2018.

Thread Status:
Not open for further replies.
  1. stevelis

    stevelis Member

    Level: Community
    Following an update visa GitHub on Wednesday 7th Feb, the following pre-filter has stopped working.
    It displays all the information for the correct '{$my->id}' but now ignores the two date filters.
    Any suggestions appreciated
    Steve
    Value = SELECT id FROM steward WHERE J_id ='{$my->id}'
    upload_2018-2-11_3-46-4.png
     
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    Which list? I'll log in to the site and check the debug output.

    -- hugh
     
  3. stevelis

    stevelis Member

    Level: Community
    Either of the following lists #49, #52, #54 have the similar pre-filters.
    Thanks
    Steve
     
  4. Sophist

    Sophist Moderator

    Level: Community
    Have you used fabrikdebug=1 to check the SQL that is being produced? And in particular whether OR is taking precedence over AND?

    i.e. I suspect that you want "start_date > 2018-01-01 AND end_date < 2018-03-31 AND (Chair = select OR steward = select OR steward = select)" but are actually getting "(start_date > 2018-01-01 AND end_date < 2018-03-31 AND Chair = select) OR steward = select OR steward = select"

    If you re-sequence the filters to be "Chair = select OR steward = select OR steward = select AND start_date > 2018-01-01 AND end_date < 2018-03-31" you may get what you want.

    As to why it has changed in the update from Github, that will need more research.
     
  5. troester

    troester Well-Known Member Staff Member

    Level: Standard
  6. Sophist

    Sophist Moderator

    Level: Community
    P.S. I was wondering what has changed in Pre-filters since your last update from Github - but not sure when that was. I was slightly worried that my PR#1914 was the cause - I can see has been included in your Github update because the Grouped buttons are now bootstrapped, but I have checked the code and don't think it could be the cause because it was essentially cosmetic to the Pre-filters tab.

    I can't find anything obvious in the Fabrik commit log back to early last year.
     
  7. Sophist

    Sophist Moderator

    Level: Community
  8. troester

    troester Well-Known Member Staff Member

    Level: Standard
    Yup.
    So maybe it's really your PR.
    There's a fairly "non-cosmetic" part...
     
  9. Sophist

    Sophist Moderator

    Level: Community
    Well my code only touches the HTML definitions in the php, and the rest is in the JS file for the pre-filter tab on the back-end which handles adding new pre-filter rows, so should not have any impact on the front-end. But I am as good as, or even better than, most folks at including bugs in my code, so it is entirely possible that this is down to a bug in my PR.
     
  10. troester

    troester Well-Known Member Staff Member

    Level: Standard
    Tested:
    it's coming from admin-filters(-min).js
    before your PR list prefilter params are
    ...."filter-grouped":["0","1","0"],
    directly after "Improve List Data Prefilter layout" commit it's
    ...."filter-grouped":{"1":"1","2":"0"},

    with (screenshot after the PR)
    upload_2018-2-12_15-23-29.png
    seems this is creating a different "filter-grouped" string in the list params
     

    Attached Files:

    stevelis likes this.
  11. Sophist

    Sophist Moderator

    Level: Community
    Oops. I will take a look.
     
    stevelis likes this.
  12. troester

    troester Well-Known Member Staff Member

    Level: Standard
    Correction:
    it's not "Improve List Data Prefilter layout" but the next one "Put group buttons inside a div."
     
    stevelis likes this.
  13. Sophist

    Sophist Moderator

    Level: Community
    Ok - I found the issue (which was that a hidden input field for the first row was not being generated - which is why there was no "n/a" on that row.

    Here are fixed files.

    I will submit a PR for it in a sec.

    @troester If you can verify it works ok, perhaps you can merge the PR.
     

    Attached Files:

    stevelis likes this.
  14. Sophist

    Sophist Moderator

    Level: Community
    @stevelis You will need to download these two files to /administrator/components/com_fabrik/views/list/tmpl/ and remove the .txt from the end of the filename. Then clear browser-cache if you don't have fabrikdebug set to do JS busting.

    And you will need to re-save the List as well I think.
     
    Last edited: Feb 12, 2018
    stevelis likes this.
  15. troester

    troester Well-Known Member Staff Member

    Level: Standard
    yes
     
    stevelis likes this.
  16. stevelis

    stevelis Member

    Level: Community
    @Sophist,@troester
    To you both, a big thanks
    Have tested 2 of the 6 pre-filters which are now working just fine.
    I will continue with the other but just wanted to let you both know it looks very good so far
    Thanks for taking the time and doing the code - way above my league at the minute
    I will leave the post open and close when all 6 are working.
    Steve
     
    cheesegrits likes this.
  17. stevelis

    stevelis Member

    Level: Community
    @Sophist,@troester
    again, thanks to both of you as all the pre-filters are now working correctly.
     
Thread Status:
Not open for further replies.

Share This Page