Is update_col List plugin working?

genyded

Active Member
Hi,

I have a list that has an element which is a dropdown. The dropdown has two choices, one being a value of '0' with a label of 'Initial' and the other a value of '1' with a label of 'Final'. I am trying to use the update_col List plugin to allow users to toggle this field from one value to the other.

If I use user select, the only value that shows up for the filed is 'All'. If I try to manually set it to 0 or 1 or the label values, it says the updates completed, but the values in the list/data are then blank.

Am I missing something? I would expect user select the show 'Initial' and 'Final' as choices. I would also expect manually specifying either the value or label (or maybe even either) to update the selected rows, but it does not seem to.

TIA,
Dale
 
It IS working, but :cool:
- with "user select"=no you have to set the value. I can remember an issue with setting 0, a workaround was to set eval and do return 0; (I don't know if there was a fix)
Edit: 0 is working on my site (without eval).

-with "user select"=yes it's showing the dropdown data defined in the element's filter settings even if the filter itself is set to none (I'm not sure if this is on purpose). If you want to see all data set the "Filter data" = show all (or global + show all in Fabrik options), otherwise it will show only the data which is already in your table (and it seems there's none in your case).
 
OK,

I did a fresh install and turned on debugging. Any attempt to update any column via the plugin returns:

An error has occurred with a eval'd field - please inform the web-site owner.
Debug: Caught exception on eval in updatecol::_process() : syntax error, unexpected end of file

This same error occurs whether or not eval is checked and regardless of the field type being updated. Any ideas where to look or what to try? The fresh install is localhost J! 3.3 with Fabrik 3.1.1 using the Protostar template.

Dale
 
OK, I figured it out (I think)...

It seems that the update values MUST have at least one row in the list already with that or those value(s). Now my question is why? If I have 6 rows in a list with the value "hello" and I want to change 3 to "goodbye", why MUST I have at least 1 row in the list with "goodbye" in it in order to do that? As long as the value I am updating to is valid (which validation should catch), who cares whether or not at least one row already exists in the list/db with it?
 
I can't replicate, updating to any value (defined or not in dropdown, existing or not in table) with userselect=no is working on my site.

BTW: recent Fabrik is 3.2 (meanwhile also shown with a GitHub update)
 
"Unexpected end of file" almost always means exactly that, an upload has truncated a file. But from the sound of your followup after that, you got that resolved.

Anyway, it sounds like this may be an issue with the "Filter Data" selection on your element(s). As Troester says, with that set to "Show All", dropdowns will show all available options, be they option settings for a dropdown element, or data from a databasejoin element's target table. With "Recorded Data" (or whatever it is), they will only show options that exist (have been selected and submitted) in the table the element is on. This is for filtering purposes, as in some cases people don't want to show options as searchable on a filter, if there aren't any to find.

Of course, in the update_col usage, the dropdowns aren't really filters, so one wouldn't expect that logic to apply. But I think we kinda wound up routing the logic that builds element dropdowns in the update_col popup through the filter building code, for reasons I forget, but no doubt made very good sense when we did it. Or not.

So ... what *may* be happening is if your element is not set to be filterable in List view, we may be ignoring the element's list filter options, and simply be applying the global option for "Filter Data". So, try enabling that element to be a list filter, and set Filter Data to "all", see if that changes anything. Or change your global setting (I think it's in the list settings somewhere. Or global options. I forget. We ave sooooo many options! Feeping Creaturism has taken it's toll over the years).

-- hugh
 
Of course, I may be entirely wrong, and this may have nothing to do with "Filter Data". But it's the only scenario I can think of that would result in yours and Troester's different observations, if Troester has the element enabled as a list filter, with "Show All", and you don't.

Let me know ...

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top