Commit 0d94c608 authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-3862: D9 readiness changes

parent 0731bd21
......@@ -11,7 +11,8 @@
function uw_sites_all_install() {
// Add web resources news feed.
$title = 'Web-resources news';
$fid = db_query('SELECT fid FROM {aggregator_feed} WHERE title = :title', [':title' => $title])->fetchCol();
$database = \Drupal::database();
$fid = $database->query('SELECT fid FROM {aggregator_feed} WHERE title = :title', [':title' => $title])->fetchCol();
if (empty($fid)) {
$feed = \Drupal::entityTypeManager()->getStorage('aggregator_feed')->create([
......@@ -33,13 +34,16 @@ function uw_sites_all_uninstall() {
$transaction = \Drupal::database()->startTransaction();
$title = "Web-resources news";
$fid = db_query('SELECT fid FROM {aggregator_feed} WHERE title = :title', [':title' => $title])->fetchCol();
$database = \Drupal::database();
$fid = $database->query('SELECT fid FROM {aggregator_feed} WHERE title = :title', [':title' => $title])->fetchCol();
if (!empty($fid)) {
db_delete('aggregator_feed')
->condition('fid', $fid)
->execute();
db_delete('aggregator_item')
->condition('fid', $fid)
->execute();
$query = $database->delete('aggregator_feed');
$query->condition('fid', $fid);
$query->execute();
$query = $database->delete('aggregator_item');
$query->condition('fid', $fid);
$query->execute();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment