File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
Listener/PostBootListener Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 3434
3535namespace Glpi \Kernel ;
3636
37+ use Config ;
3738use DBConnection ;
3839use Symfony \Component \HttpFoundation \Request ;
3940use Update ;
@@ -77,6 +78,8 @@ protected function isSymfonyProfilerEndpoint(Request $request): bool
7778 */
7879 protected function isDatabaseUsable (): bool
7980 {
80- return DBConnection::isDbAvailable () && Update::isUpdateMandatory () === false ;
81+ return DBConnection::isDbAvailable ()
82+ && Config::isLegacyConfigurationLoaded ()
83+ && Update::isUpdateMandatory () === false ;
8184 }
8285}
Original file line number Diff line number Diff line change 3434
3535namespace Glpi \Kernel \Listener \PostBootListener ;
3636
37+ use Config ;
3738use DBConnection ;
39+ use DBmysql ;
3840use Glpi \Debug \Profiler ;
3941use Glpi \Kernel \ListenersPriority ;
4042use Glpi \Kernel \PostBootEvent ;
@@ -53,7 +55,15 @@ public static function getSubscribedEvents(): array
5355
5456 public function onPostBoot (): void
5557 {
56- if (!DBConnection::isDbAvailable ()) {
58+ /** @var \DBmysql|null $DB */
59+ global $ DB ;
60+
61+ if (
62+ !DBConnection::isDbAvailable ()
63+ || !Config::isLegacyConfigurationLoaded ()
64+ || !($ DB instanceof DBmysql)
65+ || !$ DB ->tableExists (Plugin::getTable ())
66+ ) {
5767 return ;
5868 }
5969
Original file line number Diff line number Diff line change @@ -1218,6 +1218,10 @@ public function unactivateAll()
12181218 /** @var \DBmysql $DB */
12191219 global $ DB ;
12201220
1221+ if (countElementsInTable (static ::getTable (), ['state ' => self ::ACTIVATED ]) === 0 ) {
1222+ return ;
1223+ }
1224+
12211225 $ DB ->update (
12221226 $ this ->getTable (),
12231227 [
You can’t perform that action at this time.
0 commit comments