Skip to content
Snippets Groups Projects
Commit 66308dbc authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

change default value of configuration MY_INSTITUTES_DEFAULT to all, fixes #1656

Closes #1656

Merge request studip/studip!1067
parent e6f9dbc6
No related branches found
No related tags found
No related merge requests found
......@@ -291,10 +291,6 @@ class Admin_CoursesController extends AuthenticatedController
PageLayout::postError(_('Sie wurden noch keiner Einrichtung zugeordnet'));
}
if (!$GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT) {
$GLOBALS['user']->cfg->store('MY_INSTITUTES_DEFAULT', $this->insts[0]['Institut_id']);
}
// Semester selection
if ($GLOBALS['user']->cfg->MY_COURSES_SELECTED_CYCLE) {
$this->semester = Semester::find($GLOBALS['user']->cfg->MY_COURSES_SELECTED_CYCLE);
......
<?php
/**
* @author Jan-Hendrik Willms <tleilax+studip@gmail.com>
* @license GPL2 or any later version
*
* @see https://develop.studip.de/trac/ticket/7058
* @see https://gitlab.studip.de/studip/studip/-/issues/1656
*/
final class SetConfigurationMyInstitutesDefaultToAll extends Migration
{
public function description()
{
return 'Changes the default value of configuration MY_INSTITUTES_DEFAULT to "all"';
}
protected function up()
{
$query = "UPDATE `config`
SET `value` = 'all'
WHERE `field` = 'MY_INSTITUTES_DEFAULT'";
DBManager::get()->exec($query);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment