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);
?>
CommentFileSizeAuthor
#1 skinr-split_form_defaults-1945480-1.patch1.03 KBrooby
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rooby’s picture

Status: Active » Needs review
FileSize
1.03 KB

Patch for the change.

moonray’s picture

Status: Needs review » Reviewed & tested by the community

Finally got around to reviewing. Looks good.

moonray’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

rooby’s picture

Great, thank you.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.