FriendsOfREDAXO / feeds

Importiert Daten aus API-Quellen wie YouTube, Vimeo, RSS und mehr
https://friendsofredaxo.github.io/
MIT License
45 stars 15 forks source link

Whoops - Löschen eines Streams #156

Closed tbaddade closed 2 years ago

tbaddade commented 4 years ago

rex_sql_exception: Error while executing statement "DELETE FROM rex_feeds_stream WHERE id = ?" using params [4]! SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (database.rex_feeds_item, CONSTRAINT rex_feeds_item_ibfk_1 FOREIGN KEY (stream_id) REFERENCES rex_feeds_stream (id)) File: src/core/lib/sql/sql.php Line: 325

Stacktrace | Function | File | Line | | -------------------------------------------- | ---------------------------------- | -------- | | rex_sql->execute | src/core/lib/sql/sql.php | 367 | | rex_sql->setQuery | src/core/lib/sql/sql.php | 1003 | | rex_sql->delete | src/addons/feeds/pages/streams.php | 38 | | include | src/core/lib/packages/package.php | 228 | | rex_package->includeFile | src/core/lib/be/controller.php | 462 | | rex_be_controller::includePath | src/core/lib/be/controller.php | 419 | | rex_be_controller::includeCurrentPageSubPath | src/addons/feeds/pages/index.php | 14 | | include | src/core/lib/packages/package.php | 228 | | rex_package->includeFile | src/core/lib/be/controller.php | 462 | | rex_be_controller::includePath | src/core/lib/be/controller.php | 404 | | rex_be_controller::includeCurrentPage | src/core/backend.php | 215 | | require | src/core/boot.php | 137 | | require | public/redaxo/index.php | 12 |
System report (REDAXO 5.9.0, PHP 7.4.1) | REDAXO | | | ------------: | :--------- | | Version | 5.9.0 | | PHP | | | ------------: | :--------- | | Version | 7.4.1 | | OPcache | yes | | Xdebug | yes | | Database | | | ------------: | :-------------- | | Version | MariaDB 10.4.10 | | Character set | utf8 | | Packages | | | ----------------: | :--------- | | feeds | 3.1 |
alxndr-w commented 4 years ago

Aktuelles Feeds?

tbaddade commented 4 years ago

Aktuelles Feeds?

Siehe > System report

alxndr-w commented 4 years ago

Kannst du nachvollziehen, warum https://github.com/FriendsOfREDAXO/feeds/commit/5c9091e043f32e04bc5cb219438e866231b849f0 bei dir nicht ausgeführt wurde?

tbaddade commented 4 years ago

Das Problem ist vermutlich diese Zeile https://github.com/FriendsOfREDAXO/feeds/blob/master/install.php#L54

Siehe Meldung

Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (database.rex_feeds_item, CONSTRAINT rex_feeds_item_ibfk_1 FOREIGN KEY (stream_id) REFERENCES rex_feeds_stream (id)

alxndr-w commented 4 years ago

@gharlan kannst du dir das auch nochmal mit anschauen zwecks Fremdschlüssel-Schlamassel von mir?

gharlan commented 4 years ago

Der FK steht auf RESTRICT, somit lassen sich Streams nicht löschen, zu denen es Items gibt. Zu überlegen ist, was denn das gewünscht Verhalten ist. Sollen die Items mit gelöscht werden? Dann auf CASCADE umstellen.