Jump to:
| Project: | Links Package |
| Version: | 6.x-1.0-beta15 |
| Component: | Code: links_weblink.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | syscrusher |
| Status: | active |
Issue Summary
Since 6.x-1.0-beta13 or so I can not add a new weblink successfully (I think - but am not sure - it used to work for me in earlier betas).
The URL is not saved, and there are PHP and link errors.
Existing weblinks are fine (this module and its DB were upgraded from D5).
After creating a new weblink, the following is displayed under the View tab of the new node:
Cannot find or create link record for http://www.acme.com/
Weblink aaa Acme has been created.
In the Edit tab:
Link URL text box is empty; re-entring the URL produces the same result as above, and the URL stays empty.
From the log:
PHP error:
Duplicate entry '0' for key 1 query: INSERT INTO links (url_md5, url, link_title, last_click_time) VALUES ('ff95ab4a5ba314a9b79747d6a6aacde7', 'http://www.acme.com/', 'aaa Acme', 0) in /var/www/test_site/html/includes/common.inc on line 3425.
Links error:
Unable to insert URL http://www.acme.com/ into {links} table
Comments
#1
Let's see if the auto-increment column is the correct schema. Can you post the output, please, of the following MySQL command?
mysqldump --user=$db_user --password=$db_passwd --no-data $db_name links
(where $db_user, $db_passwd, and $db_name are the values from your settings.php file)
The thing we need to see is if the "lid" field is auto-increment. If not, then something went bork with the DB schema in the upgrade.
Kind regards,
Scott
#2
I have just posted a developer snapshot that implements Links update #6103, which will drop and recreate the indices on the {links} table. This may address your issue. The repository only updates these dev snapshots twice a day, so you may not be able to grab the code right away unless you go to CVS. It will be the head of the DRUPAL-6--1 branch.
Kind regards,
Scott
#3
The dev build from today (23 Jan) solved the problem.
Great support, thanks a lot Scott!
#4
Thanks for the quick feedback. This will be in the released version.
#5
#6
Automatically closed -- issue fixed for 2 weeks with no activity.
#7
I am experiencing exactly the same problem on links 5.x-1.12 (on drupal 5.16, postgres 8.3).
PHP log:
query: INSERT INTO links (lid, url, url_md5, link_title) VALUES (0, 'http://www.google.com/', 'ff90821feeb2b02a33a6f9fc8e5f3fcd', 'werwer') in /var/www/includes/database.pgsql.inc on line 145.
pg_query() [function.pg-query]: Query failed: ERROR: duplicate key value violates unique constraint "links_pkey" in /var/www/includes/database.pgsql.inc on line 126.
query: SELECT nextval('links_lid_seq') in /var/www/includes/database.pgsql.inc on line 145.
pg_query() [function.pg-query]: Query failed: ERROR: relation "links_lid_seq" does not exist in /var/www/includes/database.pgsql.inc on line 126.
I am fairly new to drupal, but I am willing to provide more info. This is quite a stopper for me...
Thanks!
Nick
#8
This seems related to a poor support of PostgreSQL on drupal and in links. Can something like this apply here?
http://drupal.org/node/138181