diff --git a/components/ILIAS/Init/classes/class.ilInitialisation.php b/components/ILIAS/Init/classes/class.ilInitialisation.php index dfdc9eed2df4..8b994604db7e 100755 --- a/components/ILIAS/Init/classes/class.ilInitialisation.php +++ b/components/ILIAS/Init/classes/class.ilInitialisation.php @@ -1158,7 +1158,7 @@ protected static function abortAndDie(string $a_message): void { if (isset($GLOBALS['ilLog'])) { $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - " . $a_message); - $GLOBALS['ilLog']->logStack(); + //$GLOBALS['ilLog']->logStack(); } die($a_message); } diff --git a/components/ILIAS/OrgUnit/classes/Setup/class.ilOrgUnitSetupAgent.php b/components/ILIAS/OrgUnit/classes/Setup/class.ilOrgUnitSetupAgent.php index d1409cc2f9bd..73af17fea34f 100644 --- a/components/ILIAS/OrgUnit/classes/Setup/class.ilOrgUnitSetupAgent.php +++ b/components/ILIAS/OrgUnit/classes/Setup/class.ilOrgUnitSetupAgent.php @@ -72,6 +72,10 @@ public function getNamedObjectives(?Setup\Config $config = null): array 'removeDeletedUsersFromOrgUnits' => new Setup\ObjectiveConstructor( 'clean assignments of deleted users', static fn(): Setup\Objective => new ilOrgUnitRemoveDeletedUsersObjective() + ), + 'removeDeletedMDSetsFromOrgUnitTypes' => new Setup\ObjectiveConstructor( + 'clean assignments of deleted meta data sets', + static fn(): Setup\Objective => new ilOrgUnitRemoveDeletedMDSetsObjective() ) ]; } diff --git a/components/ILIAS/OrgUnit/classes/Setup/ilOrgUnitRemoveDeletedMDSetsObjective.php b/components/ILIAS/OrgUnit/classes/Setup/ilOrgUnitRemoveDeletedMDSetsObjective.php new file mode 100644 index 000000000000..8bfed0bc23b2 --- /dev/null +++ b/components/ILIAS/OrgUnit/classes/Setup/ilOrgUnitRemoveDeletedMDSetsObjective.php @@ -0,0 +1,68 @@ +getResource(Environment::RESOURCE_DATABASE); + $query = 'DELETE FROM orgu_types_adv_md_rec' . PHP_EOL + . 'WHERE rec_id NOT IN (' . PHP_EOL + . 'SELECT record_id FROM adv_md_record' . PHP_EOL + . ')'; + $db->manipulate($query); + return $environment; + } + + public function isApplicable(Environment $environment): bool + { + return true; + } +}