Skip to content

Commit

Permalink
fix generic_includes.php returning error "Undefined variable in /var/…
Browse files Browse the repository at this point in the history
…www/loris/tools/generic_includes.php on line 28" - 25 branch (aces#9318)

This fixes the script `generic_includes.php` that calls the $DB variable
before it is defined when calling LorisInstance.

Without this fix, anything calling `generic_includes.php` will trigger
the following error:
```
Undefined variable in /var/www/loris/tools/generic_includes.php on line 28
PHP Fatal error:  Uncaught TypeError: LORIS\\LorisInstance::__construct(): Argument #1 ($db) must be of type Database, null given, called in /var/www/loris/tools/generic_includes.php on line 27
```
  • Loading branch information
cmadjar authored Oct 1, 2024
1 parent 0e8db0e commit 99018de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/generic_includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
$client->makeCommandLine();
$client->initialize($configFile);
$config = NDB_Config::singleton();
$DB = NDB_Factory::singleton()->database();
$lorisInstance = new \LORIS\LorisInstance(
$DB,
$config,
Expand All @@ -32,4 +33,3 @@
__DIR__ . "/../modules/",
],
);
$DB = $lorisInstance->getDatabaseConnection();

0 comments on commit 99018de

Please sign in to comment.