Notes: This is not an issue for D7 any longer (see post #299 for more info). A -perhaps- related issue for pathauto 7.x is #1236030: interface language change the path of the node.

The original problem description mentioned the error "user warning: Duplicate entry '...' for key 2 query: INSERT INTO url_alias (src, dst, language) VALUES (...)". This warning has disappeared since Drupal 6.16**. Comments up to #52 are not valid any more.

The cause of this warning, outlined in #53 along with the first patch, also caused aliases to disappear in other nodes (with same path, but different language) -- as outlined in #103. This is what the issue is mainly about, at the moment.

After various incarnations of patches:
- pfournier posted a new patch in #188 which was closely examined (by various people, a.o. roderik).
- roderik expanded on his patch according to some new info I found, which resulted in the patch in #275 after close scrutiny by pfournier.

status:

(copied from #302)

We can consider the patch well-researched.
The only 'unresolved' discussion is what the goal of the patch should be:
- only fixing the bug while taking care that as much behavior as possible is retained <- roderik's stance; patch in #275
- doing away with some illogical behavior at the same time. <- pfournier's stance; would need a little change to #275, basically scrapping an UPDATE statement.

This needs comment from the D6 core maintainer.

The difference is only in 'theoretical' edge cases; it doesn't have any effect on code in Drupal core or pathauto (or any known/reported contrib module).
(The mentioned "illogical behavior" was specified at some time, but the spec is clearly outdated.)

(** read #1106030: Node edit form risks deleting another node's path alias for the reason why the original error has disappeared.)

Files: 
CommentFileSizeAuthor
#320 core-module-path-path_set_alias-269877-320-D6.patch4.82 KBroderik
#275 core-module-path-path_set_alias-269877-275-D6.patch4.82 KBroderik
#270 core-module-path-path_set_alias-269877-270-D6.patch4.81 KBroderik
#264 core-module-path-path_set_alias-269877-264-D6.patch4.79 KBroderik
#263 core-module-path-path_set_alias-269877-263-D6.patch5.03 KBroderik
#261 core-module-path-path_set_alias-269877-261-D6.patch4.48 KBroderik
#242 path_alias.png17.42 KBDanny_Joris
#228 path_alias_lang.patch1.99 KBakaliel
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch path_alias_lang.patch.
[ View ]
#227 path_alias_2.patch1.7 KBakaliel
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch path_alias_2_1.patch.
[ View ]
#218 core-module-path-path_set_alias-269877-218-D6.patch2.61 KBfmjrey
#217 path-path_set_alias-D6.patch2.59 KBufku
#209 drupal_6_path_lang.patch1.34 KBfago
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch drupal_6_path_lang.patch.
[ View ]
#188 path-path_set_alias-269877-187-D6.patch2.59 KBpfournier
#185 path_module.patch2.59 KBpfournier
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in path_module_3.patch.
[ View ]
#184 path_module.patch2.85 KBpfournier
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in path_module_2.patch.
[ View ]
#183 path_module_269877#183.patch2.85 KBpfournier
FAILED: [[SimpleTest]]: [MySQL] Fetch test file: failed to retrieve [path_module_269877#183.patch] from project client.
[ View ]
#146 path-module_269877-D6.patch1.21 KBmathieu
#137 path-module_269877-D6.patch1.07 KBjct
#135 path-module_269877-D6.patch1.07 KBmathieu
#91 path-module-D7_with tests.patch3.37 KBneochief
FAILED: [[SimpleTest]]: [MySQL] Fetch test file: failed to retrieve [path-module-D7_with tests.patch] from project client.
[ View ]
#85 path-module-D6.patch937 bytesneochief
#85 path-module-D7.patch935 bytesneochief
Invalid patch format in path-module-D7.patch.
[ View ]
#82 path-module_D6.patch1.2 KBneochief
#82 path-module_D7.patch1.18 KBneochief
Failed: Invalid PHP syntax in path.module .
[ View ]
#78 path-module_D6.patch1.17 KBneochief
#78 path-module_D7.patch1.16 KBneochief
Failed: Failed to apply patch.
[ View ]
#69 path.module_neochief.patch1.01 KBneochief
Failed: Failed to apply patch.
[ View ]
#69 path.module_damien.patch960 bytesneochief
Failed: Failed to apply patch.
[ View ]
#53 path_module.patch1.18 KBneochief
Failed: Failed to apply patch.
[ View ]
#62 path_module_269877.patch755 bytesJo Wouters
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in path_module_269877.patch.
[ View ]
#30 path.module-path-set-alias.patch1.06 KBnonsie
Failed: Failed to apply patch.
[ View ]

Comments

@klonos & @clashar: this is only a D6 (and D5) issue. Look at #143 and #145: this was investigated and answered before.

There seems to be a bunch of patches in here that were said to fix the issue. I would really welcome some comments by Gábor to know what is missing before it can be committed. An answer to his last question (#152) was answered in #167.

@mathieu: sorry but that answer in #167 is wrong.

(
The change of the UPDATE statement in patch #146 does introduce a problem.
Suppose you save a node with language 'en' and then change the language to 'neutral'.
Currently, the alias gets updated to 'neutral' too. (And any other aliases to other nodes, having the same path + different languages, would get zapped --> the current bug.)
After applying #146, the alias would not be updated to 'neutral'. --> new bug.

Basically, the drupal_get_path_alias() call must be scrapped, or you get problems in one case or another.
)

........but that answer in #167 doesn't apply anymore (so the question doesn't either), because the patch was later completely overhauled.

pfournier posted a new patch in #183 which was closely examined (by various people, a.o. me).
I expanded on his patch according to some new info I found, which resulted in patch #275 after close scrutiny by pfournier.

status:

We can consider the patch well-researched.
The discussion we were still having is what the goal of the patch should be:
- only fixing the bug while taking care that as much behavior as possible is retained <- my stance; patch in #275
- introducing a change in behavior that makes more sense, 'logically' <- pfournier's stance; would need a little change to #275, basically scrapping an UPDATE statement.

The difference is only in 'theoretical' edge cases, not for Drupal core or pathauto (or any contrib module I know). I am just wanting to 'change as little behavior as possible in stable software', therefore adhering to an old specification which is -arguably- outdated and not very logical.

That's it.

And yes, I would also really welcome some comments by Gábor to know what is missing before it can be committed.

EDIT: Thanks for the comment, Klonos. Not used to that functionality yet. It was about time that summary got updated; the originally reported error doesn't even exist any more.

Issue summary:View changes

It was about time this was updated; the original reported error is not there any more...

Issue summary:View changes

changed references to various posts/patches where needed in order to be able to fast-jump to them:
- from #183 to #188 instead + made it link.
- made #275 links.
- made the vague reference to "the patch" an actual link to it.

Perhaps this needed to go to the issue's summary?

Tagging.

Had similar issues, patch in #275 fixed this for me, did not encounter any problems.

Cheers

Hi,

does anyone know if #275 was included in the latest dev version from 2011-Sep-07?

thanks
Rich

@richH: The patch definitely is not in the latest dev version.

I can also confirm that the patch in #275 worked for me.

This really ought to be committed.

finally post #275 fixes this problem that was ongoing for over a year now (applied it to D6.22). I'm really happy it's finally solved, please include it into the core! BTW on first sight I do not seem to experience any problems on D7 ? My problem was that on D6 the node aliasses got deleted when updated on a multilanguage site. Don't know which other problems this patch might fix.

As an update to my last comment a month ago...

We've had the patch from #275 in place on a highly trafficked, multilingual site for several weeks now without incident. It solved an extremely problematic issue where path aliases of translated content (all of which had the same alias) would die on any number of actions (including bulk updates, regular saves/edits, field syncing, etc).

I believe the patch has been very thoroughly reviewed and tested by the community. What needs to happen to get the patch committed?

Issue summary:View changes

changed description

#275 does solve the problem for me.

patch #275 works fine... it's the solution...

Please commit #275 to core.

Otherwise I have to patch core for several multilanguage sites, and I havent fallen that low in years...

Status:Reviewed & tested by the community» Needs review

I am using D6.22 and did not found #275 patch in core
i have patched the path.module but still have issues. i.e:
when i am saving a node into English the URL alias is perfect like content/[title-raw] but when i want to check the same node in Arabic it is showing drupal default node/1234 ?? any help

Status:Needs review» Reviewed & tested by the community

@aliyayasir that is correct. It have not yet been committed by the D6 maintainer.

The SELECT / INSERT pattern used in the patch looks like would be prone to race conditions, no? In searching through the comments, it does not seem likt this issue was discussed (sorry, I did not read up on all the 300+ comments posted)

Status:Reviewed & tested by the community» Needs review

Marking needs review for that for clarity.

My heart jumps when seeing your involvement in this patch, so close to feb 1st. Returning status to keep your attention ;)

Answer: the race condition isn't introduced by this patch.

The SELECT/INSERT pattern replaces 'a drupal_get_path_alias() / INSERT pattern'. drupal_lookup path() executes the same SELECT statement.
(Except the SELECT returns 3 needed fields instead of just the one alias - which is the reason for scrapping the drupal_get_path_alias() call.)

...so...

while you might want to insist on this race condition being solved: it's one that already exists in D6 (multiple rows can be inserted silently and Drupal doesn't freak out) since march 2010 - so it doesn't have to hold up the fixes in this patch, IMHO.
(Somewhat similar to #1106030: Node edit form risks deleting another node's path alias which documents another 'race-like' condition.)

Status:Needs review» Reviewed & tested by the community
StatusFileSize
new4.82 KB

Don't panic. The only difference betwee #275 and this one is s/D6.21/D6.23/ in a comment line.

(I didn't even properly reroll it.)

Status:Reviewed & tested by the community» Fixed

Thanks, committed, pushed to Drupal 6.

Awesome! Thanks Gábor, and thanks roderik! Thanks to everyone who tested the patch.

Yes, huge thanx! ...finally fixed :D

Finally, this one is nailed. I will go and drink for your health today!

Category:bug» support
Priority:Critical» Normal

Category:support» bug
Priority:Normal» Critical

@marinex: Please be careful when commenting on existing issues, do not change the issue settings unless the changes are relevant to the issue as a whole rather than specifically your question.

Status:Fixed» Closed (fixed)
Issue tags:-Needs committer feedback

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

Issue summary:View changes

...clarifying things/status for D7.

Pages