Ich habe gestern ein Upgrade von Version 4.2.11 auf 4.3.3 durchgeführt. Danach wollte ich einen existierende Veranstaltung kopieren. Dabei trat ein Datenbankfehler auf: "Integrity constraint violation: 1062 Duplicate entry '038b0028-199b-4469-8428-9e190d4bb224' for key 'adm_idx_rol_uuid'".
Code: Alles auswählen
Datenbankfehler
S Q L - E R R O R
CODE: 00000
B A C K T R A C E
FILE: adm_program/system/classes/Database.php
LINE: 797
CALL: Database->showError()
FILE: adm_program/system/classes/TableAccess.php
LINE: 570
CALL: Database->queryPrepared()
FILE: adm_program/system/classes/TableRoles.php
LINE: 454
CALL: TableAccess->save()
FILE: adm_program/modules/events/events_function.php
LINE: 375
CALL: TableRoles->save()
Powered by Admidio © Admidio Team - Impressum - Datenschutz
Code: Alles auswählen
[2024-02-15 19:32:11.565216] Admidio.INFO: SQL: SELECT * FROM adm_roles , adm_categories WHERE rol_id = ? AND cat_id = rol_cat_id [929] {"file":"/www/htdocs/w012b4c9/meldebogen.hfbhk.de/adm_program/system/classes/Database.php","line":774,"class":"Database","callType":"->","function":"queryPrepared"}
[2024-02-15 19:32:11.565546] Admidio.INFO: SQL: Found rows: 1 {"file":"/www/htdocs/w012b4c9/meldebogen.hfbhk.de/adm_program/system/classes/Database.php","line":785,"class":"Database","callType":"->","function":"queryPrepared"}
[2024-02-15 19:32:11.565567] Admidio.DEBUG: SQL: Execution time 0.330925 ms {"file":"/www/htdocs/w012b4c9/meldebogen.hfbhk.de/adm_program/system/classes/Database.php","line":789,"class":"Database","callType":"->","function":"queryPrepared"}
[2024-02-15 19:32:11.565650] Admidio.INFO: SQL: INSERT INTO adm_roles (rol_cat_id,rol_name,rol_description,rol_mail_this_role,rol_leader_rights,rol_max_members,rol_usr_id_create,rol_timestamp_create,rol_usr_id_change,rol_timestamp_change,rol_valid,rol_uuid,rol_view_memberships,rol_view_members_profiles) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?) [3,"07.07.2024 10:00 19. Tag der Schauanlagen - Zylindergebläse Muldenhütten","Verantwortlicher: XXX\n\nBesonderheiten: Es werden Berg- und Hüttenkameraden gesucht, die bei den Führungen am Zylindergebläse Muldenhütten zum Tag der Schauanlagen unterstützen.\n\nAchtung: Unfälle und Vorkommnisse sind unverzüglich dem 1. Geschäftsführer zu melden. Dies erfolgt schriftlich an verein@hfbhk.de",0,1,6,170,"2024-02-15 19:32:11",170,"2022-06-30 20:03:11",true,"038b0028-199b-4469-8428-9e190d4bb224",1,1] {"file":"/www/htdocs/w012b4c9/meldebogen.hfbhk.de/adm_program/system/classes/Database.php","line":774,"class":"Database","callType":"->","function":"queryPrepared"}
[2024-02-15 19:32:11.566655] Admidio.DEBUG: SQL: Execution time 0.977993 ms {"file":"/www/htdocs/w012b4c9/meldebogen.hfbhk.de/adm_program/system/classes/Database.php","line":793,"class":"Database","callType":"->","function":"queryPrepared"}
[2024-02-15 19:32:11.567261] Admidio.CRITICAL: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '038b0028-199b-4469-8428-9e190d4bb224' for key 'adm_idx_rol_uuid' {"file":"/www/htdocs/w012b4c9/meldebogen.hfbhk.de/adm_program/system/classes/Database.php","line":796,"class":"Database","callType":"->","function":"queryPrepared"}
Mit folgender Anpassung konnte ich das Problem lösen.
Code: Alles auswählen
--- events_function.php Fri Feb 16 16:13:04 2024
***************
*** 23,27 ****
--- 23,29 ----
require_once(__DIR__ . '/../../system/common.php');
+ use Ramsey\Uuid\Uuid;
+
if ($_GET['mode'] == 2) {
$gMessage->showHtmlTextOnly(true);
}
***************
*** 351,354 ****
--- 352,356 ----
$role = new TableRoles($gDb, (int)$pdoStatement->fetchColumn());
$role->setValue('rol_id', '0');
+ $role->setValue('rol_uuid', Uuid::uuid4());
} else {
// Read category for event participation
Systeminformationen
- PHP Version: v8.1.26
Datenbank Typ + Version: MariaDB v10.5.23
Lars