Commit 9344fd80 authored by andrei.dincu's avatar andrei.dincu

Issue #2249723 by andrei.dincu: Add callback function to take xmlsitemap...

Issue #2249723 by andrei.dincu: Add callback function to take xmlsitemap attributes from entity form
parent 65d8700f
......@@ -760,6 +760,7 @@ function xmlsitemap_add_form_link_options(array &$form, $entity, $bundle, $id) {
'#value' => $link['priority_override'],
);
$form['actions']['submit']['#submit'][] = 'xmlsitemap_process_form_link_options';
// Other persistent fields.
//$form['xmlsitemap']['lastmod'] = array(
// '#type' => 'value',
......@@ -773,12 +774,6 @@ function xmlsitemap_add_form_link_options(array &$form, $entity, $bundle, $id) {
// '#type' => 'value',
// '#value' => $node->xmlsitemap['changecount'],
//);
// Add the submit handler to adjust the default values if selected.
$form['actions']['submit']['#submit'][] = 'xmlsitemap_process_form_link_options';
/* $form += array('#submit' => array());
if (!in_array('xmlsitemap_process_form_link_options', $form['#submit'])) {
array_unshift($form['#submit'], 'xmlsitemap_process_form_link_options');
} */
}
/**
......
......@@ -1370,6 +1370,9 @@ function xmlsitemap_restore_user() {
return xmlsitemap_switch_user();
}
/**
* Submit callback for the entity form to save.
*/
function xmlsitemap_process_form_link_options($form, &$form_state) {
$link = &$form_state['values']['xmlsitemap'];
$fields = array('status' => XMLSITEMAP_STATUS_DEFAULT, 'priority' => XMLSITEMAP_PRIORITY_DEFAULT);
......@@ -1383,6 +1386,9 @@ function xmlsitemap_process_form_link_options($form, &$form_state) {
$link[$field . '_override'] = 1;
}
}
$entity = $form_state['controller']->getEntity();
$entity->xmlsitemap = $form_state['values']['xmlsitemap'];
}
function xmlsitemap_link_bundle_settings_form_submit($form, &$form_state) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment