firewall: actually fix placement by moving into alias migration

When migrating Category this fails with an error:

 Fatal error: Uncaught Error: Call to undefined method OPNsense\Firewall\Category::flushCache() in /usr/local/opnsense/mvc/app/library/OPNsense/Firewall/Util.php:176
 Stack trace:
 #0 /usr/local/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/M1_0_0.php(103): OPNsense\Firewall\Util::attachAliasObject(Object(OPNsense\Firewall\Category))
 #1 /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php(711): OPNsense\Firewall\Migrations\M1_0_0->run(Object(OPNsense\Firewall\Category))
 #2 /usr/core/src/opnsense/mvc/script/run_migrations.php(54): OPNsense\Base\BaseModel->runMigrations()
 #3 {main}
   thrown in /usr/local/opnsense/mvc/app/library/OPNsense/Firewall/Util.php on line 176
This commit is contained in:
Franco Fichtner 2023-10-29 16:36:55 +01:00
parent 28df2b8fb6
commit 63354e8726

View File

@ -92,6 +92,7 @@ class M1_0_0 extends BaseModelMigration
}
}
}
\OPNsense\Firewall\Util::attachAliasObject($model);
} elseif ($model instanceof Category) {
$model->sync();
} elseif ($model instanceof Group) {
@ -100,7 +101,6 @@ class M1_0_0 extends BaseModelMigration
$new_group->members = str_replace(' ', ',', (string)$new_group->members);
}
}
\OPNsense\Firewall\Util::attachAliasObject($model);
}
/**