Closed (fixed)
Project:
Select (or other)
Version:
7.x-2.x-dev
Component:
CCK / Field API widget
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2011 at 18:34 UTC
Updated:
1 Apr 2014 at 15:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
danielb commentedMakes sense to me, thanks!
Comment #3
puddyglum(Skip this, see comment #5)
This created a problem for us in 7.x-2.8 because the values being stored in the field table used to be literal, but now they are numerical keys. Used to be "Orange", "Green", etc., and now are 0, 1, 2, etc.
When the Node is loaded for view the real value of the field isn't available, all we get is the numerical key value.
Is there a way to make both of them work? For now we've just removed this patch from 7.x-2.8 and everything else works fine.
Comment #4
puddyglum(Skip this, see comment #5)
Nevermind, we just need to update all of our Select (or Other) fields to have Keys. In Drupal Select fields of type Text, it will automatically add the Key if you don't specify it.
What you enter into a Drupal Select widget "Allowed values list":
Option 1
After saving field:
Option 1|Option 1
I believe this module needs that now, otherwise new entries will get numerical keys by default, which could change overtime if you add/re-arrange the options. For instance, you add or re-order the fields, and suddenly a field with value 1 now displays something else.
A sample before and after (if you don't manually set keys) looks like:
Comment #5
puddyglumActually, the problem is that this fix simply assumed that if no key was specified, then it must be PHP. I've added a fix which checks for the possibility of no specified key, and no PHP. Tested and it works.
Comment #6
danielb commentedcommited
Comment #8
nicholas.alipaz commentedThe committed code has caused a bug it seems: #1532316: #1356112 caused regression in the default options for select widget with optgroups.