[development] wit's end: altering options for an optionwidgets_select element - OR - life without #DANGEROUS_SKIP_CHECK
gerhard at killesreiter.de
Mon Mar 9 23:21:44 UTC 2009
-----BEGIN PGP SIGNED MESSAGE-----
Harry Slaughter schrieb:
> I want to alter the options for a cck optionwidgets_select element based on data
> in the node itself.
> I can't use a function in the cck widget configuration page because that's
> called before the node is loaded, so I don't know what the options should be yet.
> I can't do it in hook_form_alter() because optionwidgets_select elements have
> not yet been fully rendered (the actual options for the select have not been set
> I can make the alteration using #pre_render, but then form validation has run
> already so I've corrupted the form and I fail _form_validate() and get the
> 'illegal choice...' error. And I cannot use the
> drupal_process_form()/drupal_rebuild_form() trick (as seen in AHAH) because the
> #pre_render callback does not have access to $form_state.
> I can't use #DANGEROUS_SKIP_CHECK because it has been removed.
Have you considere to add a #process function that runs after the
optionwidget one? Look at the flexifield module how to add one.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the development