Closed (won't fix)
Project:
Options Element
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Mar 2010 at 07:43 UTC
Updated:
12 Jan 2011 at 07:32 UTC
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
Comment #1
quicksketchI 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.
Comment #2
tstoecklerHow 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?!
Comment #3
quicksketchHell 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.
Comment #4
tstoecklerWell, 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!
Comment #5
quicksketchOh, 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.
Comment #6
tstoecklerNope, 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:
A form with a bunch of other "normal" form elements showed up fine, so I thought that would be the way to go.
Comment #7
quicksketchYou MUST have an option, so #options => array() is not the same as #options => array('').
Comment #8
quicksketchOh, 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().
Comment #9
tstoecklerAll right. Thanks.
I will do that.
Comment #10
tstoecklerMan, I should have tried that days ago. Works like a charm. Will turn this into a patch in the coming days.
Comment #11
quicksketchI'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.
Comment #12
moshe weitzman commentedI'd support the core patch approach. We are still open for usability fixes.
Comment #13
quicksketchYou 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.
Comment #14
Bojhan commentedI would support this too - for core.
Comment #15
tstoecklerJust 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...
Comment #16
bcn commentedMaybe too late, but...#765338: Create an 'options' FAPI element
Comment #17
BenK commentedSubscribing...
Comment #18
quicksketchWon't fixing this for now. Maybe Drupal 8.