I've been recently involved in #456640: Clarify text descriptions in Field UI for booleans, which enhances the UI for allowed values for boolean fields.
I don't know if it will be accepted, but how about revamping allowed values as a whole with this module?

Comments

quicksketch’s picture

I would LOVE for this be in core. It would make my life much much easier when making option lists in both Webform (which is what this is going to be used for shortly) and in CCK/Field. Unfortunately it's pretty late in the game for D7, though if it's at all possible I'll do what I can to help with this in Drupal 7. Despite having been made a project just yesterday, I wrote this module nearly a year ago as part of the Form Builder project. It's quite capable, though I bet there are a few lingering things that need correcting if we tested it enough.

tstoeckler’s picture

How about this:
I grab your code and try to hack it together into a patch to see what Drieschick says. If the answer is yes, you help drive it home?!

quicksketch’s picture

Hell yeah! ;-)

I've nearly hung up my hat on the D7 queue, though if we can make this happen I'll give it a full push.

tstoeckler’s picture

Well, I thought it was easier as it is. I hadn't realized you made a whole new form element =). Anyway, I could not get it work on a D6 site, so making it into a D7 core patch was kind of hopeless.
Therefore my question: What do I need to do to make it work?
I built a form that basically implements what I read here: http://drupalcode.org/viewvc/drupal/contributions/modules/options_elemen...
but it just gives me an empty (!) fieldset with the title "Options".
If there is some way to just get the JS-magic onto a textarea, that be enough I guess for the D7 version, but like I said, I couldn't really get anything to work.
Help / pointers appreciated. Thanks!

quicksketch’s picture

Oh, there's a funny limitation right now that you need to have at least one option for things to get rolling. So, specify #options => array('') for starters and then things should get rolling.

tstoeckler’s picture

Nope, doesn't work.
Just to make sure I'm not completely idiotic:
I acutally didn't write a whole new module I just enabled PHP filter made a new node and entered the following:

$form['test'] = array(
  '#type' => 'options',
  '#options' => array(), 
);
return drupal_render_form('test', $form);

A form with a bunch of other "normal" form elements showed up fine, so I thought that would be the way to go.

quicksketch’s picture

You MUST have an option, so #options => array() is not the same as #options => array('').

quicksketch’s picture

Oh, that and you can't use drupal_render_form(), since that doesn't run any #process functions. You'll need to make a form and then a menu callback that uses drupal_get_form().

tstoeckler’s picture

All right. Thanks.
I will do that.

tstoeckler’s picture

Man, I should have tried that days ago. Works like a charm. Will turn this into a patch in the coming days.

quicksketch’s picture

Version: » 7.x-1.0
Category: task » support

I've made official releases of Options Element, please be sure to work off of the 1.0 version for any patches. However I've talked with webchick about this and she doesn't seem very optimistic about the possibility. I expect I'll have the Webform 3.x patch in CVS shortly, so you'll have a practical (albeit slight confusing) example to work off of.

moshe weitzman’s picture

I'd support the core patch approach. We are still open for usability fixes.

quicksketch’s picture

You can now try out Webform for Drupal 7 and have Options Element successfully working for it (the D7 version of Options Element is now also available), note that you'll need to get the CVS version of Webform until beta 3 is out. Webform itself is much less stable than Options Element, so be prepared to do a little finicking around to get it installed initially.

For hopes of a Drupal 7 patch, this is a pretty significant chunk of code: around 1200 lines. But at the same time, we could at least reduce duplicate code from the select.module in Drupal 7, since it has its own text-to-options code.

Bojhan’s picture

I would support this too - for core.

tstoeckler’s picture

Just a short comment. I said I above that I would try to turn this into some form of a core patch. I tried that extensively, but my Form /Field API skills are just not good enough. I might give it another try, but consider me officially 'Unassigned'. Sorry...

bcn’s picture

BenK’s picture

Subscribing...

quicksketch’s picture

Status: Active » Closed (won't fix)

Won't fixing this for now. Maybe Drupal 8.