Plugin Builder: instance.publishState broken for date range datatype (when selected dynamically)?

Hmm… scratch that (original question moved to blockquote below)… Turns out the issue is more subtle. What I had done is created (via List Shifter) a date range with identical start and end points and published that.

It seems to be that, if you do this, the range doesn’t seem to be format-able… or something…

Creating a different date range (with distinctly different start and end points) and publishing it behaves as normal.

(This is a pretty odd and tweaky edge case, because zero-duration ranges are a valid thing in Bubble – e.g., Current Date/Time ← range → Current Date/Time is a valid range and causes no strangeness.)

I need to do more testing on this, but I’m pretty sure that if you have:

  • an exposed state whose type is defined via “as data type of something” data type
  • setting (in the editor) the data type to “date range” and then
  • attempting to publish a range via instance.publishState('some_date_range_state', [date_start, date_end])

… the value does not actually appear at the element’s output.

Bubble acts like publishState succeeds, but the date range value does not actually appear at the plugin’s output.

This is probably the case for numeric ranges as well. All other data types seem to work as expected.

Note that “hard coded” exposed states with “date range” or “numeric range” types work as expected. (If not, Calendar Grid Pro would not work.) This issue seems to only manifest for “variable” output types (where the state’s type is dependent on some other type selection field).

I just stumbled upon this as I was noodling with List Shifter. Anybody in plugin builder land seen this or wants to attempt to reproduce?

This topic was automatically closed after 14 days. New replies are no longer allowed.