diff --git a/src/CoreBundle/DataFixtures/SettingsCurrentFixtures.php b/src/CoreBundle/DataFixtures/SettingsCurrentFixtures.php index a851cc599c4..d7cf5468537 100644 --- a/src/CoreBundle/DataFixtures/SettingsCurrentFixtures.php +++ b/src/CoreBundle/DataFixtures/SettingsCurrentFixtures.php @@ -584,12 +584,12 @@ public static function getExistingSettings(): array 'display' => [ [ 'name' => 'show_tabs', - 'title' => 'Tabs in the header', - 'comment' => 'Check the tabs you want to see appear in the header. The unchecked tabs will appear on the right hand menu on the portal homepage and my courses page if these need to appear', + 'title' => 'Main menu entries', + 'comment' => 'Check the entrie you want to see appear in the main menu', ], [ 'name' => 'show_tabs_per_role', - 'title' => 'Show tabs per role', + 'title' => 'Main menu entries per role', 'comment' => 'Define header tabs visibility per role.', ], [ diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20251021202800.php b/src/CoreBundle/Migrations/Schema/V200/Version20251021202800.php new file mode 100644 index 00000000000..415fb570334 --- /dev/null +++ b/src/CoreBundle/Migrations/Schema/V200/Version20251021202800.php @@ -0,0 +1,60 @@ + [ + 'title' => 'Main menu entries', + 'comment' => 'Check the entrie you want to see appear in the main menu', + ], + 'show_tabs_per_role' => [ + 'title' => 'Main menu entries per role', + 'comment' => 'Define header tabs visibility per role.', + ], + ]; + + public function up(Schema $schema): void + { + $conn = $this->connection; + + foreach (self::UPDATES as $var => $meta) { + $affected = $conn->executeStatement( + "UPDATE settings + SET title = ?, comment = ?, category = 'display' + WHERE variable = ?", + [$meta['title'], $meta['comment'], $var] + ); + + $this->dbg(sprintf( + "[UP] variable='%s' -> title='%s', comment='%s', category='display' (rows=%d)", + $var, $meta['title'], $meta['comment'], $affected + )); + + if ($affected === 0) { + $this->dbg(sprintf("[WARN] No rows found for variable='%s' to update.", $var)); + } + } + } + + private function dbg(string $msg): void + { + if (self::DEBUG) { + error_log('[MIG][show_tabs_titles] ' . $msg); + } + } +}