Skip to content

Commit fa333aa

Browse files
committed
fix(Install): port of fix #76
1 parent 0ecbf0f commit fa333aa

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

install/migration/update_1.0.0_to_1.0.1.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function update100to101(Migration $migration)
4141
$update_dir = __DIR__ . "/update_{$from_version}_to_{$to_version}/";
4242

4343
//TRANS: %s is the number of new version
44-
$migration->displayTitle(sprintf(__('Update to %s'), $to_version));
44+
$migration->addInfoMessage(sprintf(__('Update to %s'), $to_version));
4545
$migration->setVersion($to_version);
4646

4747
// New tables from enpty.sql file after the migration
@@ -58,7 +58,7 @@ function update100to101(Migration $migration)
5858

5959
$dbFile = plugin_carbon_getSchemaPath($to_version);
6060
if ($dbFile === null || !$DB->runFile($dbFile)) {
61-
$migration->displayWarning("Error creating tables : " . $DB->error());
61+
$migration->addWarningMessage("Error creating tables : " . $DB->error());
6262
$updateresult = false;
6363
}
6464

install/migration/update_1.0.0_to_1.0.1/01_fix_source_zone_quebec.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* -------------------------------------------------------------------------
3131
*/
3232

33+
use Glpi\DBAL\QuerySubQuery;
3334
use GlpiPlugin\Carbon\CarbonEmission;
3435
use GlpiPlugin\Carbon\CarbonIntensitySource;
3536
use GlpiPlugin\Carbon\CarbonIntensitySource_Zone;

tests/install/PluginInstallTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,9 +777,9 @@ public function checkSourceZoneRelation()
777777
/** @var DBmysql */
778778
global $DB;
779779

780-
$source_table = CarbonIntensitySource::getTable();
780+
$source_table = Source::getTable();
781781
$zone_table = Zone::getTable();
782-
$source_zone_table = CarbonIntensitySource_Zone::getTable();
782+
$source_zone_table = Source_Zone::getTable();
783783

784784
$iterator = $DB->request([
785785
'SELECT' => $source_zone_table . '.id',

0 commit comments

Comments
 (0)