Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add row for admin module and restore boxes #1166

Merged
merged 2 commits into from
Jan 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions application/modules/admin/config/config.php
Original file line number Diff line number Diff line change
@@ -1179,6 +1179,35 @@ public function getUpdate(string $installedVersion): string
// Update vendor folder
replaceVendorDirectory();
break;
case "2.2.7":
// Add the admin module to the modules table if missing and restore the boxes of the admin module (langswitch and layoutswitch) in that case.
// The entry for the admin module was missing if it wasn't a fresh 2.2.7 install. Therefore on the update to 2.2.7 the boxes
// for the admin module looked orphaned and got deleted.
$adminEntryExists = $this->db()->select('key')
->from('modules')
->where(['key' => 'admin'])
->execute()
->fetchCell();

if (!$adminEntryExists) {
// Add the admin module to the modules table
$this->db()->insert('modules', ['key' => 'admin', 'icon_small' => ''])
->execute();

// Restore the boxes of the admin module (langswitch and layoutswitch).
$this->db()->insert('modules_boxes_content')
->columns(['key', 'module', 'locale', 'name'])
->values(
[
['langswitch', 'admin', 'de_DE', 'Sprachauswahl'],
['langswitch', 'admin', 'en_EN', 'Language selection'],
['layoutswitch', 'admin', 'de_DE', 'Layoutauswahl'],
['layoutswitch', 'admin', 'en_EN', 'Layout selection']
]
)
->execute();
}
break;
}

return 'Update function executed.';