Skip to content

Commit

Permalink
Update streams.php
Browse files Browse the repository at this point in the history
  • Loading branch information
skerbis authored Jan 15, 2025
1 parent 3e4b2ea commit c9e5a24
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pages/streams.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,21 @@
}

if ('delete' === $func) {
rex_feeds_media_helper::deleteStreamMedia($id);

// 1. Alle Media-Files für diesen Stream löschen
rex_feeds_media_helper::deleteStreamMedia($id);

// 2. Erst Items löschen (wird zwar automatisch durch FK gemacht, aber so haben wir die richtige Reihenfolge)
rex_sql::factory()
->setTable(rex_feeds_item::table())
->setWhere(['stream_id' => $id])
->delete();

// 3. Dann den Stream löschen
rex_sql::factory()
->setTable(rex_feeds_stream::table())
->setWhere('id = ?', [$id])
->setWhere(['id' => $id])
->delete();

echo rex_view::success($this->i18n('stream_deleted'));
$func = '';
}
Expand Down

0 comments on commit c9e5a24

Please sign in to comment.