multiple links with same URL make problems

Found a bug? Tell us!!
Post Reply
Evil Azrael
Regular
Posts: 22
Joined: Sat Mar 31, 2007 9:43 am
Location: Rheinkilometer 666
Contact:

multiple links with same URL make problems

Post by Evil Azrael »

When i create multiple links to the same URL in an article entry, a postgresql error complaining violation of uniqueness is shown. Only one of the links is being saved (which is not so a big problem)

Code: Select all

[...]
Warning: pg_query() [function.pg-query]: Query failed: ERROR: duplicate key violates unique constraint "serendipity_references_pkey" in /www/blog.evilazrael.de/include/db/postgres.inc.php on line 210
Error in INSERT INTO serendipity_references (id, entry_id, name, link) VALUES(310, 42, 'Im Geierforum berichtet "Zampato"', 'http://www.geierforum.de/ftopic11485.html')
ERROR: duplicate key violates unique constraint "serendipity_references_pkey"
array (
  0 => 
  array (
    'file' => '/www/blog.evilazrael.de/include/functions_trackbacks.inc.php',
    'line' => 529,
    'function' => 'serendipity_db_query',
    'args' => 
    array (
      0 => 'INSERT INTO serendipity_references (id, entry_id, name, link) VALUES(310, 42, \'Im Geierforum berichtet "Zampato"\', \'http://www.geierforum.de/ftopic11485.html\')',
    ),
  ),
  1 => 
  array (
    'file' => '/www/blog.evilazrael.de/include/functions_entries.inc.php',
    'line' => 1287,
    'function' => 'serendipity_handle_references',
    'args' => 
    array (
      0 => '42',
      1 => 'Evil Azraels Stänkerblog',
      2 => 'Otto Gutschein Aktion - Panne oder Abzocke??  ',
      3 => '[..]',
      4 => false,
    ),
  ),
  2 => 
  array (
    'file' => '/www/blog.evilazrael.de/include/functions_config.inc.php',
    'line' => 714,
    'function' => 'serendipity_updertEntry',
    'args' => 
    array (
      0 => 
      array (
        'id' => '',
        'title' => 'Otto Gutschein Aktion - Panne oder Abzocke??  ',
        'timestamp' => '1182256497',
        'body' => '[..]',
        'extended' => '',
        'categories' => 
        array (
          0 => '0',
        ),
        'isdraft' => 'false',
        'allow_comments' => 'true',
        'moderate_comments' => 'false',
        'exflag' => false,
      ),
    ),
  ),
  3 => 
  array (
    'file' => '/www/blog.evilazrael.de/include/functions_config.inc.php',
    'line' => 675,
    'function' => 'serendipity_iframe',
    'args' => 
    array (
      0 => 
      array (
        'id' => 42,
        'title' => 'Otto Gutschein Aktion - Panne oder Abzocke??  ',
        'timestamp' => '1182256497',
        'body' => '[..]',
        'extended' => '',
        'categories' => 
        array (
          0 => '0',
        ),
        'isdraft' => 'false',
        'allow_comments' => 'true',
        'moderate_comments' => 'false',
        'exflag' => false,
      ),
      1 => 'save',
      2 => true,
    ),
  ),
  4 => 
  array (
    'file' => '/www/blog.evilazrael.de/serendipity_admin.php',
    'line' => 43,
    'function' => 'serendipity_is_iframe',
    'args' => 
    array (
    ),
  ),
) 
INSERT INTO serendipity_references (id, entry_id, name, link) VALUES(310, 42, 'Im Geierforum berichtet "Zampato"', 'http://www.geierforum.de/ftopic11485.html') 
Der Eintrag wurde gespeichert (Anzeigen)
I think the problem is in "serendipity_handle_references" in functions_trackbacks.inc.php. I haven´t fully investigated this, but guess it is somehow related to the use of the linkurl as a unique key in those arrays there which will go wrong if theres a url is used more than once.

My S9Y version is 1.2b2.

Edit :
When Editing an entry, even more unique violations of the same kind are reported.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: multiple links with same URL make problems

Post by garvinhicking »

Hi!

Should be similar to the problem you reported in the past. I can't reproduce it here, though. I installed postgresql extra for this. :)

Can you please give me instructions on how to reproduce that? What text should I enter into the article, which buttons should I click? Do you modify the content when you update an existing entry?

Can you reproduce it by installing a temporary s9y installation from fresh, create your entry and save it? It might be related to the use of a special plugin!? Maybe it's related on how the 'Extended properties for entries' plugin is configured (with/without caching?)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply