Skip to content
Snippets Groups Projects
Commit c2b09a90 authored by Thomas Hackl's avatar Thomas Hackl
Browse files

check if the I18NString is an object or just a string (happens when only one...

check if the I18NString is an object or just a string (happens when only one content language is defined), re #154
parent 45510fb9
No related branches found
No related tags found
No related merge requests found
...@@ -132,9 +132,9 @@ class AdvancedBasicDataWizardStep extends BasicDataWizardStep ...@@ -132,9 +132,9 @@ class AdvancedBasicDataWizardStep extends BasicDataWizardStep
$values[__CLASS__] = array_merge($values[__CLASS__], [ $values[__CLASS__] = array_merge($values[__CLASS__], [
'subtitle' => $course->untertitel, 'subtitle' => $course->untertitel,
'subtitle_i18n' => $course->untertitel->toArray(), 'subtitle_i18n' => is_object($course->untertitel) ? $course->untertitel->toArray() : $course->untertitel,
'kind' => $course->art, 'kind' => $course->art,
'kind_i18n' => $course->art->toArray(), 'kind_i18n' => is_object($course->art) ? $course->art->toArray() : $course->art,
'ects' => $course->ects, 'ects' => $course->ects,
'maxmembers' => $course->admission_turnout, 'maxmembers' => $course->admission_turnout,
]); ]);
......
...@@ -491,11 +491,12 @@ class BasicDataWizardStep implements CourseWizardStep ...@@ -491,11 +491,12 @@ class BasicDataWizardStep implements CourseWizardStep
'coursetype' => $course->status, 'coursetype' => $course->status,
'start_time' => $course->start_time, 'start_time' => $course->start_time,
'name' => $course->name, 'name' => $course->name,
'name_i18n' => $course->name->toArray(), 'name_i18n' => is_object($course->name) ? $course->name->toArray() : $course->name,
'number' => $course->veranstaltungsnummer, 'number' => $course->veranstaltungsnummer,
'institute' => $course->institut_id, 'institute' => $course->institut_id,
'description' => $course->beschreibung, 'description' => $course->beschreibung,
'description_i18n' => $course->beschreibung->toArray() 'description_i18n' => is_object($course->beschreibung) ?
$course->beschreibung->toArray() : $course->beschreibung
]; ];
$lecturers = $course->members->findBy('status', 'dozent')->pluck('user_id'); $lecturers = $course->members->findBy('status', 'dozent')->pluck('user_id');
$data['lecturers'] = array_flip($lecturers); $data['lecturers'] = array_flip($lecturers);
...@@ -584,6 +585,9 @@ class BasicDataWizardStep implements CourseWizardStep ...@@ -584,6 +585,9 @@ class BasicDataWizardStep implements CourseWizardStep
*/ */
protected function makeI18N($values, $indices) protected function makeI18N($values, $indices)
{ {
// We only need to do something if there are several content languages.
if (count($GLOBALS['CONTENT_LANGUAGES']) > 1) {
/** /**
* Create array for configured content languages * Create array for configured content languages
*/ */
...@@ -606,6 +610,8 @@ class BasicDataWizardStep implements CourseWizardStep ...@@ -606,6 +610,8 @@ class BasicDataWizardStep implements CourseWizardStep
} }
} }
}
return $values; return $values;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment