Skip to content

Commit 6864e7f

Browse files
committed
validatePrerequisites
1 parent 95b9117 commit 6864e7f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

inc/container.class.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
* -------------------------------------------------------------------------
2929
*/
3030

31-
use Glpi\Toolbox\Sanitizer;
32-
3331
class PluginFieldsContainer extends CommonDBTM
3432
{
3533
use Glpi\Features\Clonable;
@@ -150,8 +148,15 @@ public static function installBaseData(Migration $migration, $version)
150148
}
151149

152150
// Get itemtypes from PluginGenericobject
153-
$migration_genericobject_itemtype = [];
154-
if ($DB->tableExists('glpi_plugin_genericobject_types')) {
151+
$hack = new class ($DB) extends \Glpi\Migration\GenericobjectPluginMigration {
152+
public function runValidatePrerequisites()
153+
{
154+
return $this->validatePrerequisites();
155+
}
156+
};
157+
158+
if ($hack->runValidatePrerequisites()) {
159+
$migration_genericobject_itemtype = [];
155160
$result = $DB->request(['FROM' => 'glpi_plugin_genericobject_types']);
156161
foreach ($result as $type) {
157162
$migration_genericobject_itemtype[$type['itemtype']] = [

0 commit comments

Comments
 (0)