Element Filter broken??

aldan

Member
hi,

I set an element as a drop down filter; when i initially display the list looks fine (and un-filtered), when I select something from the drop-down I get this:

getData:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIMIT 0, 10' at line 14 SQL=SELECT SQL_CALC_FOUND_ROWS DISTINCT `ajwc_photos`.`id` AS `ajwc_photos___id`, `ajwc_photos`.`id` AS `ajwc_photos___id_raw`, [...I am cutting down this...] `ajwc_photos`.`id` AS `__pk_val` FROM `ajwc_photos` WHERE ( `ajwc_photos`.`category` = ) LIMIT 0, 10

if you ask me, the value of "category" filter is not passed.

Getting exactly the same result when trying to prefilter a list

thanks
alex
 
I can confirm this (latest GitHub), beside this (new) error I can see
Notice: Undefined variable: label in C:\xampp\htdocs\j17fabrik\plugins\fabrik_element\dropdown\dropdown.php on line 261
 
nope...:-(

so, I have a list, with a "category" field as a dropdown, and I want to use that as a filter for the list. I am in the backend, I see the whole list, I see the dropdown-filter, but when I select something in it it gives me the error:

getData:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIMIT 0, 10' at line 14 SQL=SELECT SQL_CALC_FOUND_ROWS DISTINCT `ajwc_photos`.`id` AS `ajwc_photos___id`, `ajwc_photos`.`id` AS `ajwc_photos___id_raw`, `ajwc_photos`.`date_time` AS `ajwc_photos___date_time`, `ajwc_photos`.`date_time` AS `ajwc_photos___date_time_raw`, `ajwc_photos`.`category` AS `ajwc_photos___category`, `ajwc_photos`.`category` AS `ajwc_photos___category_raw`, `ajwc_photos`.`caption` AS `ajwc_photos___caption`, `ajwc_photos`.`caption` AS `ajwc_photos___caption_raw`, `ajwc_photos`.`photo` AS `ajwc_photos___photo`, `ajwc_photos`.`photo` AS `ajwc_photos___photo_raw`, `ajwc_photos`.`id` AS slug , `ajwc_photos`.`id` AS `__pk_val` FROM `ajwc_photos` WHERE ( `ajwc_photos`.`category` = ) LIMIT 0, 10

Attached is my filter settings, maybe something is wrong there

thanks
alex
 

Attachments

  • Screen Shot 2012-07-24 at 6.44.50 AM.png
    Screen Shot 2012-07-24 at 6.44.50 AM.png
    28.6 KB · Views: 302
Still the same error (Notice: Undefined variable: label in ...\plugins\fabrik_element\dropdown\dropdown.php on line 261)

I can't see any change in dropdown.php
 
Still the same error (Notice: Undefined variable: label in ...\plugins\fabrik_element\dropdown\dropdown.php on line 261)

A previous codestyle change commit broke dropdown.php. I put up a git request.
 
Ack phfffft, I did it again, committed locally and forgot to push the change up to github. Too many years of using SVN or CVS, where committing goes direct to the master repo, without the extra step of pushing local commits.

So ... I pushed my change, and closed your pull request, to avoid merge conflicts next time I pull from the master, but thanks for taking the time to contribute the fix.

-- hugh
 
No prob :) You could set a commit hook in git to automatically push, but then you handicap the use of git's cool history tools like amend commit, rebase, and a couple other undo tricks.
 
Yup. I'm still relatively new to git (I think it's my fifth source control system in 30 years), and learning the real power. But the main reason I don't usually immediately push my code changes is I like to run them for a while locally, whilst still being able to pull any other changes form the master while I test, in case someone else has made a change that effects what I'm changing. So I have to commit.

-- hugh
 
Yes and no.

So ... I pushed my change, and closed your pull request, to avoid merge conflicts next time I pull from the master, but thanks for taking the time to contribute the fix.
That means it's ready and it's in Github. However if you update your slideshow may blow up!!

So I would recommened you try the manual way first as you did with the slideshow.

https://github.com/Fabrik/fabrik/commit/74c010799bb1fd48a8e1731f4abe1f6ee088064d



Meanwhile I'll logged the visualisations issue as this should really be fixed before 3.0.6 release.

http://fabrikar.com/forums/showthread.php?t=27427
 
line 261 is funny.. should I replace
$value = $label;
with
$value = $label;??..
personally, I'm happy with the first one :)

anyway, it seems to work... so thanks again
alex
 
It looks like it was uncommented so if you have two slashes in front of that line you need to remove them.

So is the fix all working now?
 
ok, so it works for a filtered element, but, if I want to create a new list based on an existing MySQL table, filtered, it doesn't...

so:
1- new list
2- go into list edit
3- set prefilter
4- save => it's there
5- save and close
6- reopen the list edit - filter gone
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top