function webform_configure_form_submit_save in Webform 7.4
Same name and namespace in other branches
- 6.3 includes/webform.pages.inc \webform_configure_form_submit_save()
- 7.3 includes/webform.pages.inc \webform_configure_form_submit_save()
Submit handler for webform_configure_form() that saves the node.
This is separate from webform_configure_form_submit() to allow other modules to add properties if needed into the $form['#node'] object before save.
1 string reference to 'webform_configure_form_submit_save'
- webform_configure_form in includes/
webform.pages.inc - Main configuration form for editing a webform node.
File
- includes/
webform.pages.inc, line 535 - Menu callbacks and functions for configuring and editing webforms.
Code
function webform_configure_form_submit_save($form, &$form_state) {
$transaction = db_transaction();
node_save($form['#node']);
drupal_set_message(t('The form settings have been updated.'));
$node =& $form['#node'];
if (!$node->webform['block'] && function_exists('block_load') && ($block = block_load('webform', 'client-block-' . $node->nid)) && !empty($block->bid)) {
// An existing block for this not-currently-available block was already configured.
// See https://www.drupal.org/node/2365825
// The core block module contains a bug which causes it to not remove blocks
// which are no longer available in code. Therefore, to prevent the block from
// being processed, it must be removed manually here.
// Remove the block for all themes.
db_delete('block')
->condition('module', 'webform')
->condition('delta', $block->delta)
->execute();
// Remove any roles associated with the block.
db_delete('block_role')
->condition('module', 'webform')
->condition('delta', $block->delta)
->execute();
drupal_set_message(t('The block %info was deleted.', array(
'%info' => t('Webform: !title', array(
'!title' => $node->title,
)),
)));
cache_clear_all();
}
}