Commit 54d50f8d authored by Dave Reid's avatar Dave Reid

#814172 by Dave Reid: Fixed individual menu link settings not saved.

parent b861fe30
......@@ -873,7 +873,7 @@ function xmlsitemap_get_link_type_indexed_status($entity_type, $bundle = '') {
$status['visible'] = $visible->countQuery()->execute()->fetchField();
$total = db_select($info['base table']);
$total->addField('xmlsitemap', $info['entity keys']['id']);
$total->addField($info['base table'], $info['entity keys']['id']);
$total->condition($info['entity keys']['id'], 0, '>');
if (!empty($info['entity keys']['bundle'])) {
$total->condition($info['entity keys']['bundle'], $bundle);
......
......@@ -60,12 +60,15 @@ function xmlsitemap_menu_xmlsitemap_index_links($limit) {
* @param $tids
* An array of menu link IDs.
*/
function xmlsitemap_menu_xmlsitemap_process_menu_links(array $mlids) {
function xmlsitemap_menu_xmlsitemap_process_menu_links(array $mlids, array $xmlsitemap = array()) {
// Set the global user variable to the anonymous user.
xmlsitemap_switch_user(0);
foreach ($mlids as $mlid) {
$menu_item = menu_link_load($mlid);
if (!empty($xmlsitemap)) {
$menu_item['xmlsitemap'] = $xmlsitemap;
}
$link = xmlsitemap_menu_create_link($menu_item);
xmlsitemap_link_save($link);
}
......@@ -145,14 +148,16 @@ function xmlsitemap_menu_menu_delete(array $menu) {
* Implements hook_menu_link_insert().
*/
function xmlsitemap_menu_menu_link_insert(array $link) {
xmlsitemap_menu_xmlsitemap_process_menu_links(array($link['mlid']));
$link += array('xmlsitemap' => array());
xmlsitemap_menu_xmlsitemap_process_menu_links(array($link['mlid']), $link['xmlsitemap']);
}
/**
* Implements hook_menu_link_update().
*/
function xmlsitemap_menu_menu_link_update(array $link) {
xmlsitemap_menu_xmlsitemap_process_menu_links(array($link['mlid']));
$link += array('xmlsitemap' => array());
xmlsitemap_menu_xmlsitemap_process_menu_links(array($link['mlid']), $link['xmlsitemap']);
}
/**
......
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