This problem arises when you uncheck the Automatic alias box and type a new alias in. The feed alias doesn't get modified.
This means that you can create a new item (e.g. node) which will have the same generated URL alias as the original alias of the item (node) whose alias we renamed. The node aliases are fine, but pathauto will try to create an alias for the feed, only because the old feed alias didn't get renemaed we have a duplicate.
This is not as unlikely a use case as it may sound - I was manually replacing one node by a new one because I wanted to change the node type, so I renamed the alias for the old one so that the new node would get its new alias automatically --> error.
Full error text follows:
user warning: Duplicate entry 'xxxxxx/feed-en' for key 2 query: INSERT INTO url_alias (src, dst, language) VALUES ('node/25/feed', 'xxxxxx/feed', 'en') in /home/gelstle/public_html/general-ad101/modules/path/path.module on line 112.
This looks similar to one or two other issues in the queue but there may be some differences.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 324623-17_duplicate_feed_issues.patch | 1.3 KB | joelpittet |
| #8 | 324623-8_duplicate_feed_issues.patch | 1.31 KB | greggles |
| #1 | duplicate_entry.png | 544.2 KB | happysnowmantech |
Comments
Comment #1
happysnowmantech commentedI've also seen this problem in a different situation, when using feedapi_mapper to import a feed containing multiple nodes with the same title. I wonder if this is caused by a multithreading/race condition or DB commits happening out of order when updating multiple nodes.
I've attached a screenshot from where I encountered the problem while refreshing a feed. I enabled verbose mode for pathauto and also added some of my own debugging messages. At the bottom, you can see the "Duplicate entry" error message for two of the imported nodes. Previous to that, if you look at where the aliases get created for these nodes, it seems that the alias gets created, but later on _pathauto_alias_exists() returns false for that same alias?
Comment #2
kenorb commented#251908: FeedAPI: Duplicate entry after feed refresh
Comment #3
gpk commented#251908: FeedAPI: Duplicate entry after feed refresh has been designiated a FeedAPI issue. This issue is nothing to do with FeedAPI, so resetting status.
Comment #4
foripepe commentedI'm not sure, my bug is the same, but I get an error, after I update a node:
I have checked the database, and I saw this:
In the pathauto.inc file there is a pathauto_create_alias() function, where the _pathauto_alias_exists() function check, if the destination + language exist or not.
In my case the content/berg + nl is not exist, so it pass through the check. Also the _pathauto_set_alias() function fail, when it tries to set the feed.
My solution:
Comment #5
EvanDonovan commentedThis fix worked for me, thanks.
Comment #6
aangel commentedIt's not working for me. The alias gets replaced with a "-0".
Comment #7
TC44 commented#4 worked for me also. Thanks very much foripepe. I do notice that as you save a node, it does append a -0 to the alias. If you save it again, it's removed.
It does kill the errors, so that's the important thing for me.
Comment #8
gregglesHere's an actual patch. This makes sense to me.
Comment #9
gpk commentedWhile this should fix the PHP error there still remains, I think, the original issue, that if you manually update an alias, the feed alias doesn't get updated (I was assuming it would/should).
Also note there are one or 2 bugs in path module which can interact with pathauto, e.g. #543608: path.module creates additional alias instead of modifying existing, after node preview which needs a 7.x patch and another referenced there which links on to 2 more. Moral: apparent bugs in pathauto may be bugs in core... though probably not in this case...
Comment #10
TC44 commented@gpk - Thanks for the link. I'm going to test your path.module patch also to see if that solves the -0 issue for me.
Cheers
Comment #11
gpk commented@10:
>going to test your path.module patch also to see if that solves...
That patch only fixes a specific problem that occurs on node preview. However one of the linked issues might do the trick. IIRC, path_set_alias() [http://api.drupal.org/api/function/path_set_alias] should do all necessary checks to make sure DB errors don't occur. I think the D5 version behaved nicely, but it was reworked for D6.
Comment #12
dave reidMarked the following issues as duplicates of this issue:
#507736: Duplicate entry - new problem
#626528: Duplicate entry error
#635946: Create node: duplicate entry in url_alias with transliteration
Also setting back to needs work.
Comment #13
hass commented+
Comment #14
fdambrosio commented+++
Comment #15
foripepe commentedUpdated patch for Pathauto 1.4:
Comment #16
lindsayo commentedI don't know if this is the same thing, but it seems to have some of the same bits in it, so I'm posting here for now.
I'm getting that when I view a node from a type that has been auto-aliased, even if the node itself was created before my batch-auto work (and not updated since) and so does not have an automatic alias. I'm not sure what other details you need, I am using path_redirect, and tokens in my menu links, but I don't think that latter datum is relevant.
My thanks and a generous helping of karma are offered. :)
Comment #17
joelpittetHere's a patch version of #15, thanks @foripepe and @greggles
Comment #18
aangel commented