Hi there.. after installing XML SiteMap 5.x-1.3 on a site using the latest Pathauto module, the generated sitemap.xml shows http://example.com/node/[nid] for all but one node which was created before the install of the XML Sitemap module. All nodes on this particular site have a working alias, implicitly or through Pathauto.

Re-saving nodes which still show in sitemap.xml with node/nid has no effect. Disabling, uninstalling, and reinstalling XMLSitemap has no positive effect. Running update.php (for no good reason) has no effect.

New nodes created after install *do* show up in sitemap.xml with the appropriate alias.

After install, two nodes show up in xmlsitemap_node, though only one shows the appropriate alias. After creating a new node, there are three entries in xmlsitemap_node. I suspect all nodes need to be in this table in order to display the appropriate alias in the generated sitemap.xml?

After creating a new node, which displayed correctly in the sitemap, uninstalling and reinstalling all XML Sitemap modules causes only the one original node to be displayed with the proper alias again (with the same two nodes listed in xmlsitemap_node again). Once again, any new nodes created from this point forward will be displayed with the correct alias. This tells me the state of XML Sitemap after install is always constant, if not correct for this site.

After install the module weights are as follows:
xmlsitemap.module 0
pathauto.module 1
xmlsitemap_node.module 2

The previous fix which applied to gsitemap was to adjust the module weights, along with performing an edit/save on each node. With the current changes to the module, is there a new procedure which will resolve this issue for all old nodes?

Best Regards,
Damian

CommentFileSizeAuthor
#7 xmlsitemap_node_comment_count.diff599 bytesdboune

Comments

dboune’s picture

Checking back after a while, now all but the most recently created node shows up without it's alias.

darren oh’s picture

Status: Active » Closed (duplicate)

Duplicate of issue 191991.

dboune’s picture

Adding for my own records..

At this time zero nodes show the appropriate alias. Absolutely no work has been performed on the afflicted site. Zero nodes have been modified, added, or deleted.

Must have been sleepy.. correction, one node still retains an appropriate alias.

dboune’s picture

Completely cleared XML Sitemap out.. reinstalled.

All nodes show as node/nid. Noticed that during install, only nodes that have had comments are added to the xmlsitemap_node table.

Modified and ran the following query from xmlsitemap_node.install (removes dependancy on a node having comments)

INSERT INTO xmlsitemap_node (nid, pid, last_changed, last_comment, previous_comment)
SELECT n.nid, ua.pid, n.changed, s.last_comment_timestamp, MAX(c.timestamp) FROM node n
LEFT JOIN node_comment_statistics s ON s.nid = n.nid
LEFT OUTER JOIN comments c ON c.nid = n.nid
LEFT JOIN url_alias ua ON ua.src = CONCAT('node/', n.nid)
LEFT JOIN xmlsitemap_node xn ON xn.nid = n.nid
WHERE xn.nid IS NULL
GROUP BY n.nid

Delete the sitemap cache from files/xmlsitemap.

Now all nodes show with appropriate aliases.

Next I will check for behavior on node add, modify, etc...

dboune’s picture

So far so good.. after numerous node add/modify/delete operations, including changing sitemap priority, manual cron execution, deletion of the sitemap cache, I have not so far been able to break the display of the appropriate node aliases.

Looks like the only issue I've run up against was the condition on install that nodes have comments in order to be added to the xmlsitemap_node table. I will continue to monitor, and if I run up against any other related issue I'll post again.

Is this still a duplicate to 191991?

darren oh’s picture

Yes. That issue is a bit of a mess, since the owner wasn't willing to limit it to one bug.

dboune’s picture

Title: aliased nodes show as node/nid » no-comment aliased nodes not added to xmlsitemap_node table during install
Status: Closed (duplicate) » Needs review
StatusFileSize
new599 bytes

Reviewing the SQL in xmlsitemap_node.install, it appears that if the s.comment_count field is NULL, the node will be excluded. That particular case isn't captured by (s.comment_count <= 1).

Needs "OR s.comment_count IS NULL"

I don't know if there is a reason for this not being included in the SELECT statement. I've attached a diff just in case this helps in some way.

Changed title to reflect real issue.. attached patch, changed status to "patch (code needs review)"

dboune’s picture

Category: support » bug

Changed to bug report..

Sorry about the naming of the above diff. Should have been xmlsitemap_node.install.null_comment_count.diff

dboune’s picture

I see.. Ok, well... hopefully we can get those issues pruned off.

dboune’s picture

I'm just all over the place today... :(

dboune’s picture

brain train disconnection... ignore this comment.

darren oh’s picture

The patch for issue 195124 should fix this.

dboune’s picture

What software are you using to generate your patches? Looks like a good way to go.. at the moment I still fuss around on the command line running diff by hand.

darren oh’s picture

I use CVS to generate diffs against the version in the CVS repository.

cvs diff -upN

dboune’s picture

ahh.. ok.. :) I really should set myself up an appropriate environment.

I will see if I can test that other patch against postgres this afternoon.

darren oh’s picture

Status: Needs review » Fixed

Based on issue 198746, I gather that the patch for issue 195124 did fix this problem.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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