Commit 1d68c651 authored by andrei.dincu's avatar andrei.dincu

Issue #2249723 by andrei.dincu: Add callback function also for publish submit action

parent dbb2c278
......@@ -1484,6 +1484,9 @@ function xmlsitemap_add_form_link_options(array &$form, $entity, $bundle, $id) {
);
$form['actions']['submit']['#submit'][] = 'xmlsitemap_process_form_link_options';
if (isset($form['actions']['publish'])) {
$form['actions']['publish']['#submit'][] = 'xmlsitemap_process_form_link_options';
}
// Other persistent fields.
//$form['xmlsitemap']['lastmod'] = array(
// '#type' => 'value',
......@@ -1899,10 +1902,6 @@ function xmlsitemap_entity_presave(EntityInterface $entity) {
$id = $entity->id();
if (!empty($id)) {
$link = xmlsitemap_entity_create_link($entity);
/* if (isset($edit['xmlsitemap'])) {
$link = $edit['xmlsitemap'] + $link;
unset($edit['xmlsitemap']);
} */
xmlsitemap_link_save($link);
}
}
......
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