Not sure if this is a bug or whether I’m doing something wrong, but it seems the first element in an int_list array is always replaced with 0 in a data explorer query.
It looks like what is happening when you set a default value for an int_list parameter in this way:
-- int_list :categories = "3, 5, 6"
is that the following gets run:
'"1'.downcase.to_i
That will return 0.
You can get around the issue by leaving the quotes off the default parameter:
-- int_list :categories = 3, 5, 6
That value still gets interpreted as a string before being split into an array. Maybe the plugin should strip outer quotation marks if they get added to a string input.
I was sure I had tried that… and looking again now I see that changing default parameters in the body and clicking on save and run has no effect - you either have to refresh the page after saving or change the values in the box for the field as well (which I totally forgot about).
Yup, totally makes sense to do that, the magic comments were optimizing for minimum # of plugin-sourced DB migrations, which are much less of a problem these days.