Drupal 5.8, Weblinks 5.x-1.14
When using Web Links Overview to re-assign a weblink to a different category I get the message "A link with that URL already exists" and I have to abort the edit. I cannot find a workaround other than to delete the original weblink then re-create it in the correct category.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | weblinks.module.gz | 11.78 KB | rmiddle |
Comments
Comment #1
jupiterchild commentedUpdate:
Carrying out any weblink edit e.g. change title, results in the same error message as above.
Comment #2
rmiddle commentedNeed to check this. I put code in that is the node is the same to skip. I guess I need to a little more checking.
Thanks
Robert
Comment #3
jupiterchild commentedI'm working around this by using Web Links edit to add a single character to the end of the URL, re-assigning the URL to the correct Category then removing the additional character and reverting to the original URL.
Comment #4
rmiddle commentedI am looking in that and should have a fix but the end of today. Validation was just added so it is possible that you have two copies of the same link in you DB already. For a quick fix I am making the Validation optional.
Thanks
Robert
Comment #5
nancydruRobert, there is a typo in that code: A missing "s" in the variable name on the query.
Comment #6
nancydruOkay, I just did some debugging and here's what I noticed: A new node (which should have dupe checking) has no "nid" at validation time. An updated node will already have a "nid".
Comment #7
jupiterchild commentedI checked the code in my weblinks.module and the '$url_exits_nid' is correctly coded as '$url_exists_nid' in my version.
Comment #8
rmiddle commentedNot that simple I wonder how this worked when I tried it and it worked?
jupiterchild,
You are using drupal 5 correct. Is so replace weblink.module with the one attached here and see if the issue is fixed?
Comment #9
rmiddle commentedComment #10
rmiddle commentedNancyDru,
I fixed the typo in the 6 code. and commited to cvs for 6. 5 code didn't have a typo but also had $node in it not the form_state like it should have in 5.x land.
Thanks
Robert
PS. I still intend to make the validation code optional so people who want dupes or have a lot of dupes already in there DB can turn it off.
Comment #11
jupiterchild commentedOK, I have carried out a few tests and that seems to have fixed this (editing) issue. I am now able to move the Web Link from one category to another and save without error. I can also carry out other edits without error.
FYI re: http://drupal.org/node/282316
If I try and create a duplicate Web Link then I still get the "A link with that URL already exists."
Comment #12
rmiddle commentedThis version was about making the dupe check work right. I will add a interface and add the ability to make it optional before the next release.
Thanks
Robert
Comment #13
jupiterchild commentedThanks for your help, much appreciated. This module is now much improved and at last providing an easy to use weblinks manager, something Drupal has needed for quite some time.
Comment #14
rmiddle commentedI think this is two important to wait for me to add the option boxes going to release before the options are done. Marking the issue as fixes some the dupe code is working.
Comment #15
nancydru