Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Instead of #1942418: Option to have the skinr form integrated with the entity form it relates to, it would be good to split the default value getting out of skinr_ui_edit() into its own function.
This makes it easier to more cleanly replicate the skinr_ui_edit() form elsewhere.
For example, I am form altering my node form to add skinr_ui_edit() to it in a collapsible fieldset.
To do that I need to set the equivalent of:
<?php
$form_state['values']['skinr_settings'] = $skinr_defaults;
?>
However in the current state if I call drupal_get_form('skinr_ui_form') I can't have that.
I propose a system where I can do this:
<?php
$skinr_defaults = skinr_ui_form_get_defaults($module, $element);
$skinr_form = drupal_get_form('skinr_ui_form', array('module' => $module, 'element' => $element), $skinr_defaults);
?>
Comment | File | Size | Author |
---|---|---|---|
#1 | skinr-split_form_defaults-1945480-1.patch | 1.03 KB | rooby |
Comments
Comment #1
rooby CreditAttribution: rooby commentedPatch for the change.
Comment #2
moonray CreditAttribution: moonray commentedFinally got around to reviewing. Looks good.
Comment #3
moonray CreditAttribution: moonray commentedCommitted.
Comment #4
rooby CreditAttribution: rooby commentedGreat, thank you.