upgraded to gsitemap 1.11 and ran update.
paths listed ok.

upgraded to xmlsitemap 1.2 and ran update.

no path alias listed in the sitemap links.

then changed weight on xmlsitemap in system table to 2. same as gsitemap.
deleted the xmlsitemap folder. clicked save conf in xmlsitemap admin page.

still not paths listed in the sitemap.

still not showing nodes from other languages. I thought this was fixed in xmlsitemap, no?

drupal 5.3, pathauto 2.0, i18n 2.1

Comments

dsp1’s picture

Title: not showing paths only node/## » not showing path alias - only node/##
darren oh’s picture

Category: bug » support
Status: Active » Closed (fixed)

If URLs were saved incorrectly, you can disable and then uninstall the module. They will be saved correctly when you re-enable it.

darren oh’s picture

Component: xmlsitemap » xmlsitemap_node
darren oh’s picture

Status: Closed (fixed) » Fixed

Fixed in CVS commit 88061.

phazer’s picture

I have same problem, several entries in sitemap are node/xxx I looked and the ones that are this way do not have entries in xmlsitemap_node table. I have changed weight, reinstalled and uninstall modules, etc.

darren oh’s picture

You can wait for the next release or install the 5.x development release now.

zigma’s picture

tried the latest release of 5.x.

Still can't get see url alias in sitemap xml files.

dsp1’s picture

i can confirm that after upgrading from 1.2 to 1.x-dev 11-15-07 16:12 does not fix this.
i did run update and it ran update 3.
still only node/xx

gnassar’s picture

Category: support » bug
Status: Fixed » Active

They are correct; the problem still exists.

Here is why:

Upon installation, the module theoretically inserts every valid node into xmlsitemap_node table -- but it does not in practice.

xmlsitemap_node_enable() in xmlsitemap_node.install has a problem with the final SQL query (the one that actually performs the INSERTs):

the clause "WHERE xn.nid IS NULL AND (c.timestamp < s.last_comment_timestamp OR c.timestamp IS NULL)" in the query will pick up any node with no comments (c.timestamp IS NULL) and any node with more than one comment (c.timestamp < s.last_comment_timestamp, for >=1 of the comment entries for the node), but will obviously fail to insert any node that has exactly one comment (because c.timestamp will be equal to s.last_comment_timestamp). So the node will never be inserted into xmlsitemap_node, which will not stop it from being displayed in the sitemap but will stop it from using its proper path alias.

A tedious workaround would be to go to every node with exactly one comment, and re-save it -- except that will not work either. Because in xmlsitemap_node.module, the xmlsitemap_node_nodeapi() hook's update switch will fail silently if the node doesn't already exist in xmlsitemap_node table (the "UPDATE xmlsitemap_node... WHERE nid=$node->nid" will obviously fail if the nid doesn't exist, and there is no check for that ahead of time).

At least the first, and possibly the second, issue would need to be dealt with. I am very sorry that I didn't roll a patch up to submit with this comment -- I generally don't like to submit problem statements without a patch, myself, but I'm so swamped right now that I haven't had time to do that. I guess the absolute shortest "kludge" fix is to add another INSERT into the .install file specifically for the one-comment cases, but that seems pretty kludgy and I'm sure there's a better solution to be had by rewriting the SQL in the first place.

Also found one more small problem while I was checking out that code, but I'll submit in a separate issue, as it's not directly related.

darren oh’s picture

Assigned: Unassigned » darren oh

Excellent analysis. I'll get to it right away.

darren oh’s picture

Status: Active » Fixed

Fixed in CVS commit 88212.

gnassar’s picture

Kudos for the fast turnaround time! I don't get issues fixed that fast on my own module, and it's comparatively tiny :-)

dsp1’s picture

Status: Fixed » Active

not fixed. i downloaded 1.x-dev 11/17/2007 4:11 version. not sure why that was a new version the only changes were to the .info date stamp.
still not showing path alias - only node/## for pre upgrade nodes.
newly created nodes have the alias.

darren oh’s picture

Status: Active » Fixed

Sounds like the changes didn't get into the dev release. Try getting the changes from CVS.

dsp1’s picture

Status: Fixed » Active

Darren, no that is not it. I double checked the cvs and current dev.

those changes were included in yesterdays changes. i tried yesterdays and it did not fix it. I downloaded todays and only the info files were different than yesterdays. i was just commenting that todays upload was no different. so why the update?

but still the changes did not fix my problem. maybe gnassar problem is a little different than mine.
all the nodes have no path alias except for newly created ones. for me it has nothing to do with comments.

darren oh’s picture

Status: Active » Postponed (maintainer needs more info)

The update is to fix previously created nodes. Did you run xmlsitemap_node update 3?

dsp1’s picture

yes back on comment #8 the upgrade ran #3. do I need to force it to run again with the newest dev?

darren oh’s picture

Yes. It is designed for users who are upgrading from version 1.2, therefore it may change until version 1.3 is released.

dsp1’s picture

I manually selected xmlsitemap_node module Update #3 and clicked update.
it seemed to run fine. i checked the sitemap.
no change after update. still only nodes/xx

i even disabled the modules and clicked uninstall and then re-enabled.
still no change. only node/xx

darren oh’s picture

Is the weight of the xmlsitemap_node module still 2? What is the weight of the pathauto module?

dsp1’s picture

pathauto is set to 1
xmlsitemap, xmlsitemap_engines, anre xmlsitemap_node are set to 2.
not using the other modules right now.

i deleted the xmlsitemap folder. in xmlsitemap admin I clicked save but the folder does not get recreated. i have to uninstall and reinstall for it to recreate the folder.
i remember gsitemap recreated if you clicked save config, correct?

looks like there are two problems here. not sure if you want this a separate issue.

i noticed one items was missing from the sitemap. it had one comment.
so I tested. i went to another node that was on the sitemap and added one comment.
i also edited the node and submitted the node. now gone from the sitemap.

i added another comment to the node for a total of 2. and edit and submit.
the node still does not show on the sitemap.

plus there is another issue I will post separately.

darren oh’s picture

I am still unable to reproduce the problem. However, I have set up two demo sites, one for the current release and one for the development version. Please see if you can reproduce the problem there, and report your results. You will find links to the demo sites at http://xmlsitemap.darren.oh.name/.

darren oh’s picture

Status: Postponed (maintainer needs more info) » Fixed

Setting back to fixed until I hear otherwise.

dsp1’s picture

Status: Fixed » Active

I tried the newest version 11-19-2007. Still not fixed.

Not sure what I could do on your site. I don't have admin so what good would it be?
I have two sites myself with different configs that I have tested.

Darren, why do you change to fixed when it is not fix? What is the rush? Most developers make a fix then wait to see if people report it fixed and don't change the status for maybe two weeks.

I am trying to help you test this, it is not encouraging when you change the status to fixed when it is not.

darren oh’s picture

Status: Active » Fixed

You do have administrative access on the demo sites. They are fresh Drupal sites, reset every half hour. You just need to create an account. I have fixed this particular issue, so please do not set this issue to active unless you can reproduce the problem there. Feel free to open a new support request if the fix for this issue has not helped you.

dsp1’s picture

Status: Fixed » Active

I tried your test server twice. There is no content to update from a gsitemap install. So how would I test that? I keep getting locked out and all changes are reset too soon. I did notice there was no clean url set and the system did not let me set that.
i18n is not setup and there is not enough time before reset.

I tried 1.3 on my server. uninstalled and reinstalled and this is still not fixed.
i turned off several modules including Gallery2, but that is not it.

since I created the issue, why would I need to create another issue to report the same thing.
on previous issues when it was not the same issue, but a little similar you would change my post to duplicate.
you need to be more consistant.

so I am setting back to active since I would be best to judge if it is fixed.

darren oh’s picture

Assigned: darren oh » Unassigned

There is no point in having an open issue for a problem that affects only your site. I set it to fixed because a specific problem with the module has been fixed, not because your site is fixed. If something else needs to be fixed, it's new issue.

You can enable the Generate module on the demo site and create as much content as you like. And you can enable clean URLs; I've tested it.

dsp1’s picture

What makes you think it is just my site? Several other users posted in this topic about having the same issue.
Many people may just be watching and waiting and not posting and many other new users don't know how to post.

gnassar’s picture

I was one of the people that reported the same issue. The issue I had is now fixed.

Then again, I gave a much more detailed description than "path aliases are not working." The specific issue I presented got resolved, and I now have no "node/xx" entries in my sitemap.

If this is an important fix for you, I can't imagine the 30mins to drop another installation of Drupal somewhere, throw in pathauto and this module, and generate a category and some dummy content is any more time than you've already invested saying "this still doesn't work."

So try it with a clean install (your own if Darren's is giving you so much trouble), and then report back. And if you don't have the problem with the clean install, find out what it is in your production build that isn't in the clean build that is causing that problem, and report back. It could be that another patch is necessary, but if you don't give more details no one is going to be able to take a wild goose chase upon themselves to try and fix a problem they can't see. You've been around the block here for a bit; I'm sure I don't have to tell you that without enough information to replicate a problem, the problem's very unlikely to be fixed.

dsp1’s picture

i appreciate the suggestion, but the problem is with nodes created while using gsitemap. updating to xmlsitemap broke the alias's. creating new nodes are fine. i have installed and uninstalled the module with no change.

I was using Darrens server and trying many things. it is basically a clean install.
the data is new not an previous install. so adding new data or using devel generator is not going to recreate this problem.
it did not help that was that the server kept resetting after 30 minutes.
setting up i18n takes a while.

i have done hours of testing different senarios. No solution yet. I have two servers a test and production. Both have the same issue.

I have provided a lot of detail already and I was just saying not fixed because the status was changed to fixed.

I agree that the more information the better, but also I try to be concise and not repeat myself. I have not reported every detail, but only what I thought was relevant. I am continuing to test and have spent maybe 8 hours testing. I will test more and I will report back if I can find what is causing it.

darren oh’s picture

Status: Active » Postponed (maintainer needs more info)
darren oh’s picture

Category: bug » support
hass’s picture

Version: 5.x-1.2 » 5.x-1.3
Status: Postponed (maintainer needs more info) » Active

I have upgraded gsitemap 1.10 to gsitemap to 1.11 and then installed xmlsitemap 1.3 in parallel. After xmlsitemap has been installed i have removed the gsitemap folder.

I saw that xmlsitemap_node.pid is filled with the timestamp value of last_changed...

hass’s picture

Priority: Normal » Critical
hass’s picture

Category: support » bug
darren oh’s picture

Category: bug » support

I will investigate tomorrow night (US/Eastern).

hass’s picture

Category: support » bug

I have done some manual SQL tweaks.

Executed:

UPDATE xmlsitemap_node xn, url_alias ua SET xn.pid = ua.pid WHERE ua.src = CONCAT('node/', xn.nid)

This fixed the xmlsitemap_node.PID field for all nodes that have url_aliases.

Executed:

UPDATE xmlsitemap_node xn, node n SET xn.last_changed = n.changed WHERE n.nid = xn.nid

This fixed some timestamps that have had a value of NULL.

So now - only bug in this table i have is - there are some NID's that does not have an url_alias definied. They have now the last_changed as pid. What must be the default value for this xmlsitemap_node.pid field if there is no alias? Is the value "0"?

hass’s picture

Darren: please don't make this a support request... it's a bug in the module... the source in not clear yet, but a way to fix some bugs...

hass’s picture

Uhhhh shi* - xmlsitemap_node.priority_override contains the value that should be in xmlsitemap_node.pid. What the heck happens here??? Are all my priority overwrites lost!???

hass’s picture

PLACE here your SQL query that reset the xmlsitemap_node.pid to NULL of all nid's that do not have an url_alias

I've done this by hand, while the site have only 6 urls without alias...

The following will reset the priority_override values to 0 to get this fields fixed, too. However all priority_override's values set in gsitemap are now lost... how good i haven't used this feature much - yet and i only have only ~100 pages on this site. I don't like going back to my backup now, but others need to do so.

UPDATE xmlsitemap_node SET priority_override = 0

So you have now xmlsitemap_update_4... but not the source of this data deleter... my site is fixed now, but the other sites will not be upgraded until this bug is fixed... hopefully sleep well now.

hass’s picture

Aside i cannot trust this code... is a value of "-1" in previous_comment a valid value? i have no idea what this could mean and not the time to review all code... i have not enabled comment module on this site... maybe this need to be reset to NULL, too. I have no idea...

hass’s picture

And not to forget previously_changed have sometimes a value of NULL... looks wrong, too. I can say for sure the nodes have a node.created and node.changed value that differs... so i think there should be value in both xmlsitemap_node columns (last_changed, previously_changed).

hass’s picture

This is about xmlsitemap_node module:

Aside, you should never do SELECT 1 FROM {system}. You cannot be save about the order... it's much saver to name the column, only a side note.

Name all columns - "*" is very unsave about the column order... this line maybe the real cause of this bugs:

INSERT INTO {xmlsitemap_node} SELECT * FROM {gsitemap}
hass’s picture

Looks like i'm correct with this last comment. See the following mysql backup... the order of columns is different and this causes the above insert to fail.

DROP TABLE IF EXISTS `gsitemap`;
CREATE TABLE `gsitemap` (
  `nid` int(10) unsigned NOT NULL default '0',
  `last_changed` int(11) default NULL,
  `previously_changed` int(11) default NULL,
  `last_comment` int(11) default NULL,
  `previous_comment` int(11) default NULL,
  `priority_override` decimal(2,1) default NULL,
  `pid` int(11) default NULL,
  PRIMARY KEY  (`nid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
hass’s picture

Status: Active » Needs work
StatusFileSize
new1.13 KB

Here is a patch to fix the module. This should solve the destroyed _node table for users migrating from gsitemap.

This patch is missing xmlsitemap_update_4 hook to correct currently destroyed tables. This is why i marked this patch as CNW.

hass’s picture

StatusFileSize
new2.13 KB

Extended patch. I found the xmlsitemap_additional build from gsitemap_additional is destroyed, too. This patch fixed this, but misses the update hook too.

darren oh’s picture

Thank you for your work on this, Hass. Finally we have an explanation for why some people who upgrade from gsitemap have a problem and others don't. Some updates to gsitemap added or removed columns, which would change their order. The fix is simple and will prevent the problem for those who upgrade in the future.

Fixing the problem for those who have already upgraded is not going to be easy, since we do not know the column order of the original tables. Not only that, but the priority override and URL values would be mangled if inserted into integer columns. Unless we can create an update that will work for everyone, this may have to be dealt with in support requests.

In answer to your questions about proper values for columns

  • Priority override should be null to use the default value. -1 means exclude from site map.
  • Previously changed should be null when link is inserted. It will be replaced with the value from last changed when the node is updated.
hass’s picture

* Priority override should be null to use the default value. -1 means exclude from site map.
* Previously changed should be null when link is inserted. It will be replaced with the value from last changed when the node is updated.

Something seems to be wrong with this. If the value of "Priority override" is NULL the sitemap.xml only displays a blank priority - no value is visible. If i import my old data i have a default value of "0" and this displays a value of "0.0". If the field does contain NULL the SQL requests in http://drupal.org/node/194780 fails, while >=0 does not match a NULL value and therefor the WHERE does not work. This field should have a default value of "0".

Additional PID should be "0", too. If i go into a node and set "not in sitemap" the value for PID becomes NULL. The Import from gsitemap added a "0" here. You should go ONE way... aside this would solve some bugs to be consistent. I found there are many inconsistencies in the DB about NULL values and you should really take a look over your work, the current module code looks not trust worthy for me. Make it easier and don't use NULL. It would prevent you writing some complex SQL statements, while you can be save there is a value inside and you don't need to check IS NULL or 0 and such stuff. I haven't checked all, but it looks to me that code looks sometimes more difficult as it should be...

Yep i think to this update is difficult. Aside the DROP'ed gsitemap table does not allow to correct this anymore :-(. Then we should commit the latest patch now to prevent further data loss... and release a new version ASAP with the latest bugfixes.

hass’s picture

Status: Needs work » Needs review
hass’s picture

Title: not showing path alias - only node/## » xmlsitemap replacement messed up columns after upgrade from gsitemap

Changed title to reflect the real bug.

dboune’s picture

Just to add.. Darren has marked my support request http://drupal.org/node/195556 as a duplicate of this issue. One difference in my specific experience is that I did not perform an upgrade from gsitemap.

Sorry, I have not had time to review the code yet. Hence my bringing the issue up as a support request and not a bug. I didn't use this topic as the title didn't appear to fit the issue I am currently experiencing. I will review my particular issue, and the XML Sitemap code and respond as soon as possible.

federico’s picture

Just to add.. I had this problem on a site running drupal 5.5 on php5 and mysql5 server. Upgrading from gsitemap give me this problem, and also tried removing tables and reinstalling, without success. Downgrading to gsitemap 5.x-1.11 worked.

On another site running drupal 5.5 on php4 and mysql 4 server, it gave me no problems.

hass’s picture

For an upgrade from an old gsitemap installation you NEED the patch in #46. If not your tables are broken and data IS LOST! I don't know why this patch is not already committed and a new release available. Data loss is a really critical issue!!!

Darren: PLEASE...

darren oh’s picture

Status: Needs review » Reviewed & tested by the community

The order of your gsitemap columns depends on which version of gsitemap you originally installed. That's why this issue does not affect every site. The patch has not been applied because I was under the impression that it changed column values and was missing something, and I was too busy to fix it. Now I see that Hass was referring to the fact that it does not fix already-messed-up tables. Since that cannot be done automatically, this is ready to be committed.

darren oh’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in CVS commit 90766.

hass’s picture

Status: Fixed » Reviewed & tested by the community

No, this only make sure a gsitemap replacement works without any harm and data loss. About fixing already broken tables you said we should only create support requests. But if this bug is release we don't need to support someone, if nothing get's broken :-).

hass’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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