I recently updated to latest dev release for the latest bugfixes.
The previous release I was using did not have these issues and was dated 2009-03-18.

The sitemap is including some non-node addresses without lastmod or changfreq tags:

<url>
  <loc>http://www.domain.test/node/add</loc>
  <priority>0.7</priority>
</url>
<url>
  <loc>http://www.domain.test/user2userpoints</loc>
  <priority>0.5</priority>
</url>
<url>
  <loc>http://www.domain.test/userpoints</loc>
  <priority>0.5</priority>
</url>

The last two are from the userpoints module. However only the 'user2userpoints' entry disappears when I disable the userpoints module (the last entry remains), suggesting it isn't the userpoints module's fault.

One thing that has changed before I upgraded was use of the domain access module to run several subdomains on a single install. I am unsure if this has anything to do with it.

CommentFileSizeAuthor
#10 xmlsitemap_menu.patch609 bytesmr.j

Comments

mr.j’s picture

Component: xmlsitemap_node.module » xmlsitemap_menu.module

The strange entries disappear when I disable xmlsitemap_menu.module and reappear when I re-enable it so it appears the problem lies there.

avpaderno’s picture

Category: bug » support

The module has an option that allows to select which menu add in the sitemap; to see a link like node/add, you must select Navigation as menu to use to include links in the sitemap.
Also, the links taken by a menu cannot have a value for change, or lastmod because there isn't a change date associated with menus.

What you describe is not a bug, but it's how the module normally works. Check the XML sitemap settings for your site.

mr.j’s picture

Category: support » bug

Thanks, you are right, but I have definitely found a bug.

It is because XMLSitemap_menu always selects one menu, even if you deselect all the menu checkboxes. So if you uncheck them all, then save, it re-selects the first menu which in my case is the Navigation menu. I guess I just did not notice it doing this before.

avpaderno’s picture

Title: node/add in sitemap » Code always select the first menu in the list, even when the user deselect all of them

Then, the issue title must be changed as well.

avpaderno’s picture

Status: Active » Postponed (maintainer needs more info)

I checked the code to be sure, but I don't see any code lines that do what you reported.

mr.j’s picture

Neither could I - it just uses the standard drupal form posting code, which is very strange.
But it definitely happens.

avpaderno’s picture

Would you be able to make a test by adding a line of code? I am not currently able to test it myself because my priority in these days is the Drupal 6 branch, and then I will not able to work on >em>XML sitemap for two months (I need to take a vacation myself too).

mr.j’s picture

Sure no problem, just post it here and I will test it (its not a big issue now because I have set it to use the XML sitemap menu which is empty).

avpaderno’s picture

In xmlsitemap_menu_form_alter() change the following code from

      $form['xmlsitemap_menu']['xmlsitemap_menu_menus'] = array(
        '#type' => 'checkboxes',
        '#title' => t('Menus to include in sitemap'),
        '#default_value' => variable_get('xmlsitemap_menu_menus', array()),
        '#options' => menu_get_root_menus(),
        '#checkall' => TRUE,
      );
      $form['xmlsitemap_menu']['xmlsitemap_menu_menus'] = array(
        '#type' => 'checkboxes',
        '#title' => t('Menus to include in sitemap'),
        '#default_value' => array_filter(variable_get('xmlsitemap_menu_menus', array())),
        '#options' => menu_get_root_menus(),
        '#checkall' => TRUE,
      );

I am not sure it should work, but that is the only part of the code that could give some problems.
If that doesn't work try changing it in:

      $form['xmlsitemap_menu']['xmlsitemap_menu_menus'] = array(
        '#type' => 'checkboxes',
        '#title' => t('Menus to include in sitemap'),
        '#default_value' => variable_get('xmlsitemap_menu_menus', array()),
        '#options' => menu_get_root_menus(),
      );

My second thought is that the problem is caused or by Check All, or by the presence of the specific form item for it.

Thanks for helping with this issue.

mr.j’s picture

StatusFileSize
new609 bytes

The array_filter call fixes the problem. Thanks

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Fixed

The code has been changed, and committed in CVS.
Thanks for your help in resolving this issue; it is well appreciated.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

sun.core’s picture