Jump to content

Select Fieldtype - No zero index?


BrendonKoz
 Share

Recommended Posts

The default IDs created for a Select Fieldtype seem to start from the numerical digit of 1. However, we're supposed to be able to define our own custom id and title values. In my case, I was trying to assign a value of zero as the ID assigned to the first title so that sort order could be properly maintained (floors of a building, where "ground" = 0).

From my tests, with the standard Select Fieldtype, the ID is redefined automatically as the largest numerical value (ex: 0:ground, 1:floor 1, 2:floor 2, 3:floor 3 - ID for "ground" becomes 4). For the Combo field's internal value of a Select, its ID value ends up becoming null.

I couldn't find if this is a documented and known limitation anywhere and am wondering if I'm just doing something silly. Trying to force the ID back to 0 will prompt the user to delete the associated entry.

image.png.df961df30adf0e16c6a466fa954eb411.png

After trying to update the ID for "ground" to a numeric value of zero:

image.thumb.png.6fb5b1484acfcf9b841333546bfec561.png

 

Link to comment
Share on other sites

Hi @Robin S, and thank you for the reply! That's a good workaround. I was too focused on the oddity to even consider that. That said, in your opinion, do you think it is fairly safe to say that the limitation exists? I don't know if it's a bug, per se, or just a limitation -- but unless my attempts to search for "zero" in the forums was just too broad, I couldn't find anything that mentioned it. Do you think it should be submitted as a bug, or as a documentation update request? (I'm thinking the latter is simpler.)

EDIT: Actually, it seems that the ProFields Combo doesn't support the x=y|z format, only x=y. That'd be a different forum though so since it's related I will followup there. For now I'll have to adjust my IDs to start from 1, and make sure to remember this when using it as output.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...