summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-11-20 06:49:47 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-11-20 06:49:47 +0000
commit4cc8ae69a1df3d7ac1f33122c1a6afa6ba65fc0f (patch)
treefef7107ec164b66c946453221d33ed5ccd193450 /modules
parent9abb496d8a32da3e644d6c0095a89d76544ba211 (diff)
downloadbrdo-4cc8ae69a1df3d7ac1f33122c1a6afa6ba65fc0f.tar.gz
brdo-4cc8ae69a1df3d7ac1f33122c1a6afa6ba65fc0f.tar.bz2
#830704 by fago, effulgentsia, Frando: Fixed entity forms cannot be properly extended.
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/comment.module7
-rw-r--r--modules/field/tests/field_test.entity.inc5
-rw-r--r--modules/node/node.pages.inc8
-rw-r--r--modules/taxonomy/taxonomy.admin.inc5
4 files changed, 10 insertions, 15 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 31738a566..2e9b86ade 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -2003,7 +2003,6 @@ function comment_form($form, &$form_state, $comment) {
// Attach fields.
$comment->node_type = 'comment_node_' . $node->type;
- $form['#builder_function'] = 'comment_form_submit_build_comment';
field_attach_form('comment', $comment, $form, $form_state);
return $form;
@@ -2013,7 +2012,7 @@ function comment_form($form, &$form_state, $comment) {
* Build a preview from submitted form values.
*/
function comment_form_build_preview($form, &$form_state) {
- $comment = $form['#builder_function']($form, $form_state);
+ $comment = comment_form_submit_build_comment($form, $form_state);
$form_state['comment_preview'] = comment_preview($comment);
$form_state['rebuild'] = TRUE;
}
@@ -2154,7 +2153,7 @@ function comment_submit($comment) {
/**
* Updates the form state's comment entity by processing this submission's values.
*
- * This is the default #builder_function for the comment form. It is called
+ * This is the default builder function for the comment form. It is called
* during the "Save" and "Preview" submit handlers to retrieve the entity to
* save or preview. This function can also be called by a "Next" button of a
* wizard to update the form state's entity with the current step's values
@@ -2174,7 +2173,7 @@ function comment_form_submit_build_comment($form, &$form_state) {
*/
function comment_form_submit($form, &$form_state) {
$node = node_load($form_state['values']['nid']);
- $comment = $form['#builder_function']($form, $form_state);
+ $comment = comment_form_submit_build_comment($form, $form_state);
if (user_access('post comments') && (user_access('administer comments') || $node->comment == COMMENT_NODE_OPEN)) {
// Save the anonymous user information to a cookie for reuse.
if (!$comment->uid) {
diff --git a/modules/field/tests/field_test.entity.inc b/modules/field/tests/field_test.entity.inc
index 37695bd49..4c0269d3e 100644
--- a/modules/field/tests/field_test.entity.inc
+++ b/modules/field/tests/field_test.entity.inc
@@ -355,7 +355,6 @@ function field_test_entity_form($form, &$form_state, $entity, $add = FALSE) {
}
// Add field widgets.
- $form['#builder_function'] = 'field_test_entity_form_submit_builder';
field_attach_form('test_entity', $entity, $form, $form_state);
if (!$add) {
@@ -387,7 +386,7 @@ function field_test_entity_form_validate($form, &$form_state) {
* Submit handler for field_test_entity_form().
*/
function field_test_entity_form_submit($form, &$form_state) {
- $entity = $form['#builder_function']($form, $form_state);
+ $entity = field_test_entity_form_submit_build_test_entity($form, $form_state);
$insert = empty($entity->ftid);
field_test_entity_save($entity);
@@ -407,7 +406,7 @@ function field_test_entity_form_submit($form, &$form_state) {
/**
* Updates the form state's entity by processing this submission's values.
*/
-function field_test_entity_form_submit_builder($form, &$form_state) {
+function field_test_entity_form_submit_build_test_entity($form, &$form_state) {
$entity = $form_state['test_entity'];
entity_form_submit_build_entity('test_entity', $entity, $form, $form_state);
return $entity;
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 166a510c7..261ac5c67 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -306,9 +306,7 @@ function node_form($form, &$form_state, $node) {
}
$form += array('#submit' => array());
- $form['#builder_function'] = 'node_form_submit_build_node';
field_attach_form('node', $node, $form, $form_state, $node->language);
-
return $form;
}
@@ -327,7 +325,7 @@ function node_form_delete_submit($form, &$form_state) {
function node_form_build_preview($form, &$form_state) {
- $node = $form['#builder_function']($form, $form_state);
+ $node = node_form_submit_build_node($form, $form_state);
$form_state['node_preview'] = node_preview($node);
$form_state['rebuild'] = TRUE;
}
@@ -410,7 +408,7 @@ function theme_node_preview($variables) {
}
function node_form_submit($form, &$form_state) {
- $node = $form['#builder_function']($form, $form_state);
+ $node = node_form_submit_build_node($form, $form_state);
$insert = empty($node->nid);
node_save($node);
$node_link = l(t('view'), 'node/' . $node->nid);
@@ -443,7 +441,7 @@ function node_form_submit($form, &$form_state) {
/**
* Updates the form state's node entity by processing this submission's values.
*
- * This is the default #builder_function for the node form. It is called
+ * This is the default builder function for the node form. It is called
* during the "Save" and "Preview" submit handlers to retrieve the entity to
* save or preview. This function can also be called by a "Next" button of a
* wizard to update the form state's entity with the current step's values
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index 52cecb298..63729fbb1 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -642,7 +642,6 @@ function taxonomy_form_term($form, &$form_state, $edit = array(), $vocabulary =
$form['#term'] = (array) $term;
$form['#term']['parent'] = $parent;
$form['#vocabulary'] = $vocabulary;
- $form['#builder_function'] = 'taxonomy_form_term_submit_builder';
// Check for confirmation forms.
if (isset($form_state['confirm_delete'])) {
@@ -792,7 +791,7 @@ function taxonomy_form_term_submit($form, &$form_state) {
return;
}
- $term = $form['#builder_function']($form, $form_state);
+ $term = taxonomy_form_term_submit_build_taxonomy_term($form, $form_state);
$status = taxonomy_term_save($term);
switch ($status) {
@@ -835,7 +834,7 @@ function taxonomy_form_term_submit($form, &$form_state) {
/**
* Updates the form state's term entity by processing this submission's values.
*/
-function taxonomy_form_term_submit_builder($form, &$form_state) {
+function taxonomy_form_term_submit_build_taxonomy_term($form, &$form_state) {
$term = $form_state['term'];
entity_form_submit_build_entity('taxonomy_term', $term, $form, $form_state);