Closed (fixed)
Project:
Pathauto
Version:
5.x-2.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2008 at 06:33 UTC
Updated:
18 Feb 2009 at 02:05 UTC
Error message:
user warning: Duplicate entry '2569' for key 1 query: INSERT INTO url_alias_extra (pid, dst, entity_type, entity_id, created_by) VALUES (2569, 'user/jgoldberg/track/feed', 'tracker', 125, 'Pathauto') in /var/www/localhost/htdocs/drupal6/sites/all/modules/pathauto/pathauto.inc
on line 355.
The section of code in pathauto_create_alias that adds aliases for */feed paths does not check to see if an old alias exists. When _pathauto_set_alias is called, since $old_alias is not marked, the function assumes a prior alias does not exist and attempts an insert, and a duplicate entry warning occurs.
| Comment | File | Size | Author |
|---|---|---|---|
| pathauto.inc_.patch | 1.29 KB | jgoldberg |
Comments
Comment #1
gregglesI'm likely to commit this, but can you clarify the exact steps to reproduce? I haven't encountered this bug just yet.
Thanks, very much!
Comment #2
jgoldberg commentedI was able to reproduce it with a fresh Drupal instance.
Steps to reproduce:
1) Have both Pathauto and Tracker modules enabled
3) In the Pathauto settings, check "Bulk generate" and "Create feed aliases" under User-tracker
4) Go to My Account
5) Press Save
Comment #3
gregglesApplied to both 5.x and HEAD (6.x). Thanks very much, jgoldberg! http://drupal.org/cvs?commit=97483
There was a slight code style issue I fixed. In the else block you forgot to add 2 spaces to indent the $update_data line. Small issue, of course, but something to watch for in the future...which, I hope there will be a future of you helping to fix bugs in Pathauto ;)
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5
michelleI've got a client getting this error in 5.x-2.1. Haven't tried the dev, yet. Should I?
Michelle
Comment #6
michelleActually, nevermind. I _thought_ he was on 2.1 but he was actually on a slightly older version. Upgrading to 2.1 fixed it.
Michelle
Comment #7
Jean-Philippe Fleury commentedI have a "Duplicate entry" warning with Drupal 6.9, Pathauto 6.x-1.1 and Path Redirect 6.x-1.0-beta1. In the page /admin/build/path/pathauto, if I check "Bulk generate aliases for terms that are not aliased" in the "Taxonomy term path settings" section, I have these warning:
Is it related to this current bug?
Note that I've made a bug report on the Path redirect tracker: #376024: user warning: Duplicate entry