diff --git a/components/ILIAS/Block/Block.php b/components/ILIAS/Block/Block.php index 19ea49e12a65..eb7c57ca819e 100644 --- a/components/ILIAS/Block/Block.php +++ b/components/ILIAS/Block/Block.php @@ -32,6 +32,9 @@ public function init( array | \ArrayAccess &$pull, array | \ArrayAccess &$internal, ): void { + $contribute[\ILIAS\Setup\Agent::class] = static fn() => new \ilBlockSetupAgent( + $pull[\ILIAS\Refinery\Factory::class] + ); $contribute[Component\Resource\PublicAsset::class] = fn() => new Component\Resource\ComponentJS($this, "ilblockcallback.js"); } diff --git a/components/ILIAS/Block/classes/Setup/class.ilBlockDBUpdateSteps.php b/components/ILIAS/Block/classes/Setup/class.ilBlockDBUpdateSteps.php new file mode 100644 index 000000000000..058b91abcf04 --- /dev/null +++ b/components/ILIAS/Block/classes/Setup/class.ilBlockDBUpdateSteps.php @@ -0,0 +1,36 @@ +db = $db; + } + + public function step_1(): void + { + if (!$this->db->indexExistsByFields('il_block_setting', ['user_id'])) { + $this->db->addIndex('il_block_setting', ['user_id'], 'i1'); + } + } +} diff --git a/components/ILIAS/Block/classes/Setup/class.ilBlockSetupAgent.php b/components/ILIAS/Block/classes/Setup/class.ilBlockSetupAgent.php new file mode 100644 index 000000000000..cfb3c807b180 --- /dev/null +++ b/components/ILIAS/Block/classes/Setup/class.ilBlockSetupAgent.php @@ -0,0 +1,42 @@ +