From 2551703dcca254d8b7121e7a940cb1208d293113 Mon Sep 17 00:00:00 2001 From: Christian Beeznest Date: Tue, 21 Oct 2025 20:32:33 -0500 Subject: [PATCH] Internal: Update titles/comments for show_tabs and show_tabs_per_role - refs #6926 --- .../DataFixtures/SettingsCurrentFixtures.php | 6 +- .../Schema/V200/Version20251021202800.php | 60 +++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 src/CoreBundle/Migrations/Schema/V200/Version20251021202800.php 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); + } + } +}