Email
Share

We Rock Your Web Forum » Content Management Systems » Drupal

Drupal XMLSitemap Comments Update

(3 posts)
  1. JeffNox

    member
    Joined: Aug '09
    Posts: 24

    I'm trying to get my 6.x Drupal 6.x-1.2 sitemap to update nodes when a comment is added. It appears to only be updating when a node is changed.

    I searched the support issue queue on drupal.org and it looks like they've fixed the issue in the latest 6.x-2.x-dev release. However, when I try and upgrade, I get numerous errors.

    After a fresh uninstall and reinstall of xmlsitemap I get the following error when I try and add a sitemap:

    Fatal error: Cannot use object of type stdClass as array in /home/<user>/public_html/modules/xmlsitemap/xmlsitemap.admin.inc on line 232

    And the page keeps showing "There are currently no XML sitemap contexts available."

    When I try and visit /sitemap.xml I get a 404 (page not found).

    Frustrating!!

    Posted 1 year ago #

  2. Posted 1 year ago
  3. cwd

    senior admin
    Joined: Jul '09
    Posts: 225

    Uninstall the sitemap module again, flush all caches, and delete (after backing up) the /files/xmlsitemap directory.

    If you get a "permission denied" error when trying to delete it, you can create this page, with input format set to "php" within Drupal, to reset permissions. Substitute backtick marks for the <backtick> tags (this forum turns them into code tags). And, make sure you delete this page when you're done:

    <?php
    <backtick>chmod -R a+w files/xmlsitemap<backtick>;
    ?>

    Next, search your database (via phpMyAdmin/ mySQL) for any instances of "xmlsitemap". If you find any, view them to make sure they're old xmlsitemap entries, and then delete them. We found a bunch in our "system" table.

    Next, try installing the sitemap module again - first only the base module, then the add-on modules.

    Finally, run cron. Hopefully you'll see your sitemap file listed now.

    Posted 1 year ago #
  4. cwd

    senior admin
    Joined: Jul '09
    Posts: 225

    If you're not comfortable installing the latest unstable -dev release, but still want your lastmod updated based on the comment time (not the node change time), you can change the following line in your /modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module file:

    Line 243 (in 6.x-2.0-beta1) (line 230 in 6.x-2.x-dev from 9/6/10):
    $node->xmlsitemap['lastmod'] = isset($node->changed) ? $node->changed : REQUEST_TIME;

    Update to:
    $node->xmlsitemap['lastmod'] = count($timestamps) ? max($timestamps) : 0;

    Posted 1 year ago #

RSS feed for this topic

Reply

(required)

Allowed markup: BBcode blockquote code em strong ul ol li font strike center u hr.
You can also put code in between backtick ( ` ) characters.