Recent Topics

[Fixed] Duplicate entry error after renaming plugin events

started by on Feb 16, 2009 – Last touched: Feb 16, 2009

Feb 16, 2009 00:00    

MySQL error!

Duplicate entry '17-stw_webshots_s' for key 1(Errno=1062)

Your query:

INSERT INTO evo_pluginevents( pevt_plug_ID, pevt_event, pevt_enabled )

VALUES ( 17, "stw_webshots_s", 1 ), (17, "stw_webshots_l", 1 ), (17, "stw_webshots_xl", 1 )

echo 'obsolete_events';
pre_dump($obsolete_events);

echo 'discovered_events';
pre_dump($discovered_events);

Code

obsolete_events
array(3) {
  [5]=>
  string(14) "stw_webshots_L"
  [6]=>
  string(14) "stw_webshots_S"
  [7]=>
  string(15) "stw_webshots_XL"
}

Code

discovered_events
array(3) {
  [4]=>
  string(14) "stw_webshots_S"
  [5]=>
  string(14) "stw_webshots_L"
  [6]=>
  string(15) "stw_webshots_XL"
}

Feb 16, 2009 01:04

I replaced singe quotes with escaped double quotes and everything is good now :)

inc/plugins/model/_plugins_admin.class.php #694

Code

"DELETE FROM T_pluginevents
WHERE pevt_plug_ID = ".$Plugin->ID."
AND pevt_event IN ( \"".implode( '", "', $obsolete_events )."\" )";

Feb 23, 2009 21:23

??
I cannot see, how this should be relevant..

Can you still produce it with using single quotes (which are SQL standard btw)?

I rather think that the error only occured once, due to the given circumstances - and needs another fix.

Which b2evo version are you using?

Feb 23, 2009 21:28

Ah, I see now from looking closer at it, that the quotes did not match before.
Thanks for fixing it!

Feb 24, 2009 01:25

Yeah, I committed a slightly different fix :)


Form is loading...

powered by b2evolution free blog software – This forum is powered by b2evolution CMS, a complete engine for your website.