Skip to content

Commit

Permalink
away: fix adding calendar_events entry (#788)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackcoder87 authored Sep 28, 2023
1 parent 08e84cc commit ea09c9f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions application/modules/away/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Config extends \Ilch\Config\Install
{
public $config = [
'key' => 'away',
'version' => '1.6.0',
'version' => '1.6.1',
'icon_small' => 'fa-solid fa-calendar-xmark',
'author' => 'Veldscholten, Kevin',
'link' => 'https://ilch.de',
Expand Down Expand Up @@ -71,7 +71,7 @@ public function getInstallSql()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;';

if ($this->db()->ifTableExists('[prefix]_calendar_events')) {
$installSql.'INSERT INTO `[prefix]_calendar_events` (`url`) VALUES ("away/aways/index/");';
$installSql .= 'INSERT INTO `[prefix]_calendar_events` (`url`) VALUES ("away/aways/index/");';
}

return $installSql;
Expand Down Expand Up @@ -104,6 +104,12 @@ public function getUpdate($installedVersion)
$databaseConfig->set('away_adminNotification', 1);
case "1.5.0":
$this->db()->query("UPDATE `[prefix]_modules` SET `icon_small` = 'fa-solid fa-calendar-xmark' WHERE `key` = 'away';");
case "1.6.0":
if ($this->db()->ifTableExists('[prefix]_calendar_events')) {
if (!$this->db()->select('url', 'calendar_events', ['url' => 'away/aways/index/'])->execute()->getNumRows()) {
$this->db()->query("INSERT INTO `[prefix]_calendar_events` (`url`) VALUES ('away/aways/index/');");
}
}
}
}
}

0 comments on commit ea09c9f

Please sign in to comment.