Also activate main mode if not already enabled upon submode acitvation

This commit is contained in:
phl0
2025-06-25 11:21:04 +02:00
parent 1a2344f2de
commit 6580021ab2

View File

@@ -63,6 +63,10 @@ class Usermodes extends CI_Model {
foreach ($raw_modes as $row) {
if (($row->id == $clean_id) || ($row->active == 1)) {
$modes[]=$row->mode.'~'.($row->submode ?? '');
// Also activate main mode if not active to keep mode/submode ordering in dropdown menu
if (array_search($row->mode.'~', $modes) === false) {
$modes[] = $row->mode.'~';
}
}
}
$this->user_options_model->set_option('usermodes', 'enabled_usermodes', array('json_modes' => json_encode($modes)));