Closed (fixed)
Project:
XML sitemap
Version:
5.x-1.3
Component:
xmlsitemap_node
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2007 at 15:41 UTC
Updated:
24 Dec 2007 at 03:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
darren ohI couldn't reproduce this on either the 5.x-1.3 or the 5.x-1.x-dev demo site. There's not enough information here to fix anything.
Comment #2
rondev commentedWhat kind information do you need? As I don't know I cant help. If you think my posted issue is not valuable, you may ignore what I say. Perhaps someone more qualified here could help you.
Ronan
Comment #3
darren ohYou can
Also, filing bugs against the development version makes it harder to help you, since the code is unstable. Development versions should only be used to check fixes for bugs in the latest official release.
Comment #4
hass commentedSame issue here with v1.3. I set 4 nodes to "Not in site map" the priority_override value has changed to "-1" in DB, but the node is nevertheless listed in sitemap.xml. Aside the xmlsitemap_node.PID is set to NULL. I think it should be 0... or better to say there seems to be inconsistencies... as reported in http://drupal.org/node/191991
Comment #5
hass commentedPatch to fix this bug is attached.
I have tested with 'page', 'story' only and both together excluded and additional with some nodes that have priority -1. All have worked well.
Comment #6
hass commentedSame bug is inside xmlsitemap_term, too. Untested and not included in this patch.
Comment #7
hass commentedThis patch should fix both submodules... but i haven't tested xmlsitemap_term myself regarding this bug, yet.
Comment #8
hass commentedAside, someone should check xmlsitemap_user... i'm not using this submodule and the SQL looks different. Code looks like a possible "0" vesus "NULL" problem... but not sure.
Comment #9
darren ohThe patch prevents nodes whose type is excluded from overriding that exclusion. I still can't reproduce the problem. This is how it works for me:
As far as I can tell, the module is working as designed.
Comment #10
hass commentedUhhh... no - i get the idea behind, but this is not logic from usability and totally intransparent to users. If this is the way how the module is "designed" you should rethink this illogical part and commit this patch.
1. Think about a tree view logic:
"Do not show node stype in sitemap"
--> "Do not show individual node in sitemap"
All defaults to "show in sitemap", what we could expect if someone installs xmlsitemap.
2. please keep in mind - i have over 100.000 nodes and i cannot look inside every node by hand. I cannot check every story of the priority match the default value or have in individual value that may drop some nodes from the sitemap or not. If i say "do not show stories" - NO story should be visible and not only the one that have a default value set. Maybe i change the default priority for stories from 0.1 to 0.5, but have them set to "do not show in sitemap" and then my nodes with 0.5 are no more displayed!? How strange is this...
3. If i'm higher in the tree this should overrule lower values and not mix them up - sometimes so and sometimes so. It is a general decision to not show a node type. If someone don't like to show his stories he should be aware they are no more displayed. If he want them back showing we could enable this node type to be displayed.
I would recommend users are staying at gsitemap for now until such and some other bugs and usability hassles are fixed. I'm thinking of going back or keep staying there for now, too.
Comment #11
darren ohgsitemap was also designed to allow the priority to be overridden for individual nodes. It's quite clear that the node type priority is only the default priority for nodes.
I moved the code for node URLs into the xmlsitemap_node module so that you can easily replace it with your own module if you do not like how it works.
Comment #12
darren ohBy the way, from one of your posts in another issue, I think your problem is that you set the priority_override for all your nodes to 0. To use the default priority, it must be null.
Comment #13
hass commentedI tried both 0 and NULL. NULL gave me *nothing* in the sitemap.xml and not the default value (BUG). The value 0 on the other side worked correctly. I haven't had time to review all of this bugs, but this is not correct behavior.
About the exclusion it was required to use 0 or the filter
xt.priority_override >= 0will not match! Without the above patch it is not possible to exclude nodes.I tried to exclude 5 nodes and set them to "do not display in sitemap", but nevertheless of this individual setting the node was shown. Please don't tell me this "by design" to ignore this individual node setting if the node type will be displayed by default.
Comment #14
darren ohYou must be using a patched version of the module. It works perfectly for me. Please see if you can reproduce the bug on the official demo site.
Comment #15
hass commentedNo. This is a test with unpatched and buggy version 1.3. The following is the MySQL line of "node/4".
This is a story and story node type is not excluded from sitemap. The individual node/4 have priority_override = -1 and therefor should not be displayed in sitemap.xml, but it is. The patch in #7 fixes this bug.
Comment #16
hass commentedPatch needs work for situation where priority_override = NULL
Comment #17
darren ohThis may not even be a bug. Please try to reproduce the problem in the standard environment provided by the demo site. You will find links to the demo sites at http://xmlsitemap.darren.oh.name.
If you succeed in reproducing the problem, please provide the following information:
Comment #18
hass commentedThis is not helpful... how can i look inside the DB and delete the sitemap tar file?
Comment #19
hass commentedOK, reproduced this on http://xmlsitemap.darren.oh.name/5.x-1.3/?q=en/content/asdad
1. Simply create a story (content/asdad)
2. set the story to not display in sitemap
3. reload sitemap.xml
The last entry shouldn't be there.
Comment #20
darren ohIt's a new, clean Drupal install with no users, created with an installation profile that enables XML Sitemap and related modules. Just create an account.
Comment #21
darren ohThank you. I will investigate.
Comment #22
dublin drupaller commentedvery useful module. great work.
I'm experiencing the same problem with the latest 5.x-1.3 version (Nov 26th). Just flagging that it's still an issue and will try the patches posted earlier.
Dub
Comment #23
dboune commentedThe attached patches resolving the aforementioned priority exclusion issues for nodes and terms. NULL values are handled.
In the long term, the use of NULL should probably be done away with.
I have NOT looked into the user module yet.. but will in a few.
Comment #24
dboune commentedchanging to patch (code needs review)
Comment #25
hass commentedI think this like is wrong... haven't tested this again, but think about what will happen here:
(n.type NOT IN ('". implode("', '", $excludes) ."') OR xn.priority_override >= 0)1. we have an exclude 'page'
2. this should cause 'page' to not show in sitemap...
3. if this have a value higher then 0 it will be displayed. I remember - Darren wants this - however i hate this very much, while i have removed all 'page's on global level and nevertheless someone have set a higher value of some pages to more then 0 in past... but today our decision is to remove all 'page's and not to show them.
4. if xn.priority_override = NULL, this should cause a fall back to "default" value. If this default value is higher then 0 the page will be displayed... very confusing... it sounds i'm may be wrong here.
5. the following would cause NULL value links to show in sitemap... but what is about a default value of "-1" ? This should cause no links to show...
AND (xt.priority_override IS NULL OR xt.priority_override >= 0I have some troubles to follow the NULL part without using IFNULL/ISNULL and this confusing illogical parts...
Comment #26
dboune commented@hass
(n.type NOT IN ('". implode("', '", $excludes) ."') OR xn.priority_override >= 0)The above statement only affects note type excludes, not page excludes. I should add that it does effect implicit page (node) includes when the node type has been excluded.
AND (xt.priority_override IS NULL OR xt.priority_override >= 0The above allows anything except nodes with a priority of -1 to show in the sitemap. "Not in site map" is a synonym for the priority value of -1.
Overall, both condition sets must be satisfied for an item to show in the sitemap. So if a node is excluded by it's node type in the first statement, then the second statement has no real effect.
Case scenarios:
Node Type Exclusion
Page is set to Default (NULL): Statement1= FALSE && Statement2 = TRUE - Node is excluded.
Page is set to non-default: Statement 1 is TRUE && Statement 2 = TRUE - Node is implicitly included.
Node Exclusion (Node type is !not! -1)
Page is -1: Statement1 = TRUE && Statement2 = FALSE: Node is excluded
Page is != -1: Statement1 = TRUE && Statement2 = TRUE: Node is included
Comment #27
hass commented"page" is a "node type"
Comment #28
dboune commentedYes, I realize that.. using the word page in this context is just a handy way of not confusing Node Type and Node. Sorry..
Comment #29
dublin drupaller commentedJust updating this thread...
I tried the patch provided by dboune (post #23) for the xmlsitemap_node.module and it worked for me.
i.e. it correctly excluded "Not in site map" nodes from the site map.
thanks dboune.
Dub
Comment #30
darren ohFixed in CVS commit 90807.
Comment #31
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.