• 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.

List Pre-filters and F3.8

Status
Not open for further replies.

stevelis

Member
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
 
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.
 
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.
 
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.
 
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
and the rest is in the JS file for the pre-filter tab on the back-end which handles adding new pre-filter rows,
seems this is creating a different "filter-grouped" string in the list params
 

Attachments

  • upload_2018-2-12_15-17-44.png
    upload_2018-2-12_15-17-44.png
    18.4 KB · Views: 61
Correction:
it's not "Improve List Data Prefilter layout" but the next one "Put group buttons inside a div."
 
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.
 

Attachments

  • admin-filters.js.txt
    11.8 KB · Views: 22
  • admin-filters-min.js.txt
    6.5 KB · Views: 20
@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:
@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
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top