FIX: Incorrect admin sidebar setting migration (#25192)

Fixes the migration in 8c6144d116
which was unconditionally enabling the new admin sidebar for admins
if they ever changed the old setting `enable_admin_sidebar_navigation`,
even if they changed it to false.
This commit is contained in:
Martin Brennan 2024-01-10 07:24:23 +10:00 committed by GitHub
parent cef6aca6e5
commit f2105727c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ class ChangeEnableAdminSidebarToGroupPostMigration < ActiveRecord::Migration[7.0
"SELECT value FROM site_settings WHERE name = 'enable_admin_sidebar_navigation'",
).first
if enable_admin_sidebar_navigation_raw.present?
if enable_admin_sidebar_navigation_raw.present? && enable_admin_sidebar_navigation_raw == "t"
DB.exec(
"INSERT INTO site_settings(name, value, data_type, created_at, updated_at)
VALUES('admin_sidebar_enabled_groups', :setting, '20', NOW(), NOW())",