Skip to content
Snippets Groups Projects
Commit 6a462953 authored by Justus Dieckmann's avatar Justus Dieckmann
Browse files

Interpret 1 as semesterindependent instead of 0, because 0 counts as no value

parent efe9f15f
Branches
No related tags found
No related merge requests found
...@@ -68,7 +68,7 @@ class data_controller extends \core_customfield\data_controller { ...@@ -68,7 +68,7 @@ class data_controller extends \core_customfield\data_controller {
public function instance_form_definition(\MoodleQuickForm $mform) { public function instance_form_definition(\MoodleQuickForm $mform) {
$field = $this->get_field(); $field = $this->get_field();
$formattedoptions = array( $formattedoptions = array(
0 => get_string('semesterindependent', 'customfield_semester') 1 => get_string('semesterindependent', 'customfield_semester')
); );
$showmonthsintofuture = $this->get_field()->get_configdata_property('showmonthsintofuture'); $showmonthsintofuture = $this->get_field()->get_configdata_property('showmonthsintofuture');
$endtime = new DateTime("+$showmonthsintofuture months"); $endtime = new DateTime("+$showmonthsintofuture months");
...@@ -132,7 +132,7 @@ class data_controller extends \core_customfield\data_controller { ...@@ -132,7 +132,7 @@ class data_controller extends \core_customfield\data_controller {
* @return string|null The human readable semester name * @return string|null The human readable semester name
*/ */
public static function get_name_for_semester(int $value) { public static function get_name_for_semester(int $value) {
if ($value === 0) { if ($value === 1) {
return get_string('semesterindependent', 'customfield_semester'); return get_string('semesterindependent', 'customfield_semester');
} else if ($value == null) { } else if ($value == null) {
return null; return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment