filters not working correctly (and question on url filtering)

skyrun

Active Member
on http://www.skyrun.com/skyforce/score-elements

i have added a dropdown filter on a multi-select database join element (activity type).

however:
  1. the drop down list has the correct first 5 elements, then a bunch of blanks and numeric elements that shouldn't be there.
  2. if you select one of the activity types, the list isn't filtered.
  3. after selecting the item, the item isn't retained in the filter.
also wanted to do this same thing via the url (ie score-elements?sf_activity_score___activity_id=2046&sf_activity_score_element___activity_type=ichat). there used to be a wiki or forum entry on how to prefill filters, but i can't find it...
 
Can't seem ot duplicate this.

Does you actual recorded data contain rows for options on that don't exist any more?

I'll probably need to look at phpMyAdmin to work this one out, if you can put that in your My Sites, or catch me on live chat / Skype.

-- hugh
 
phpMyAdmin details are already on my sites. no, there are not rows for options that don't exist any more. there are only 10 records in the table.
 
Ooops, sorry about that, forgot I hadn't added the phpMyAdmin details to the profile tab here in XenForo, it's only over in the J! list.

OK, I'll carry on working on this. Just wish I could replicate it here ...

-- hugh
 
I'm going to have to put in some debug code that exits during filtering ... is there a good / bad time of day to do this?

-- hugh
 
i'm not in production until sept 9th. so debug away. this afternoon is a particularly GOOD time as i'll be in transit the rest of the afternoon and you'll have the system to your self.

thanks for asking!
 
Hmmm, well, I seem to have hosed your data.

I changed the "Filter data" from "Recorded" to "Show All".

When I saved, it asked me to change the field type from INT to VARCHAR, so I said yes ... that should be safe, as INT's can always cast to VARCHAR ... but after reloading the list, all the Activity Type's are blank.

Erm ... do you have a backup you can load?

And ... I realized your multie-select join is in a repeat group. My test isn't. And I know things get horrible complex with multi-select joins in a repeat group, as the multi-select join is itself a join, so we end up having to handle two levels of join ...

So ... two more issues I need to resolve first ... why it wanted to change the field type when I changed the filter settings, and why that ended up with data loss. Converting from VARCHAR to INT will lose data, unless it's all numbers, but INT to VARCHAR should be safe.

-- hugh
 
bummer... but the good news is that if you're referring to the 'type' column on 'sf_score_element', it's only 10 records and i can recreate it in a matter of minutes and that table is just sample data anyway. looking around, i think that's all that i think you 'hosed'. PLUS i believe that the data for that column is actually stored in sf_score_element_repeat_type anyway... and it's all still there. that table refers back using the 'parent_id' column if i understand how it works...

the issue now is that that column is hosed up so when i try to add a multi select for one of the elements (like on http://www.skyrun.com/skyforce/score-elements/form/5/300 for example, select incoming phone and outgoing email as two selections), it gives this error when saving:
Unknown column 'Array' in 'where clause' SQL=DELETE FROM sf_score_element WHERE id = Array AND !(`sf_score_element`.`id`IN (1))

the multiselect logic in v3.1 still needs some work (realizing at the same how how utterly complex it must be).

also seems that every time i edit the 'type' element, (http://www.skyrun.com/skyforce/admi...on=com_fabrik&view=element&layout=edit&id=203) it tries to change the underlying db to something different. i've seen int(6), int(11) and varchar(255) depending on my settings or something... not sure what. but like i say, i don't think that column is used anyway... in favor of sf_score_element_repeat_type.

so looks like all you 'broke' was the fabrik link between the sf_score_element_repeat_type table 'helper table' and the sf_score_element 'real' table. not sure how to get that back... but i know i've broken it before too... and then all of a sudden, it starts working again... would be nice to have it work all the time to state the obvious.

can you (or rob) help piece this back together and get it working so i can multiselect from the 5 available activity types (iphone, ophone, iemail, oemail, ichat), and then filter based on which ones are selected? that's what i'm ultimately trying to do. be able to, from a url, ask for a list of just the score_elements that are applicable for incoming phone calls (filter for type=iphone as any of the multi-selected items) make sense?
 
hi Barray

This should be resolved now - the code changes are on your site and in github. You may need to edit the records to re-add the actual activity types (I've added some for testing purposes)
For filtering via the query string this worked for me:

&sf_score_element___type=iphone
 
Did we (by which of course I mean you!) work out what killed the data in the first place, when I changed the "Filter data" option from All to Recorded?

Barry - suggest you do a db backup, then try that, see if it blows your data away again. If it does, reload the backup, and let me know.

-- hugh
 
Well not at 100% but there were bugs in the way we saved/retrieved data from multi-select db join elements which were located in joined groups which may well have explained the data loss
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top