Skip to content
Snippets Groups Projects
Commit d40e6154 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #3727

Closes #3727

Merge request !2613
parent 94960f72
No related branches found
No related tags found
No related merge requests found
...@@ -591,10 +591,10 @@ class Admin_PluginController extends AuthenticatedController ...@@ -591,10 +591,10 @@ class Admin_PluginController extends AuthenticatedController
'manifest_info_en' => [ 'manifest_info_en' => [
'label' => sprintf(_('Standardbeschreibung des Plugins (%s)'), _('Englisch')), 'label' => sprintf(_('Standardbeschreibung des Plugins (%s)'), _('Englisch')),
'type' => 'info', 'type' => 'info',
'value' => $this->metadata['descriptionlong_en'] ?? $this->metadata['description_en'], 'value' => $this->metadata['descriptionlong_en'] ?? $this->metadata['description_en'] ?? null,
'if' => "STUDIPFORM_SELECTEDLANGUAGES.description === 'en_GB'" 'if' => "STUDIPFORM_SELECTEDLANGUAGES.description === 'en_GB'"
], ],
'decription_mode' => [ 'description_mode' => [
'label' => _('Modus der neuen Beschreibung'), 'label' => _('Modus der neuen Beschreibung'),
'type' => 'select', 'type' => 'select',
'options' => [ 'options' => [
......
...@@ -16,7 +16,11 @@ class I18n_textInput extends Input ...@@ -16,7 +16,11 @@ class I18n_textInput extends Input
$value = $this->value; $value = $this->value;
} else { } else {
$value = [\I18NString::getDefaultLanguage() => $this->value->original()]; $value = [\I18NString::getDefaultLanguage() => $this->value->original()];
$value = json_encode(array_merge($value, $this->value->toArray())); $value = array_merge($value, $this->value->toArray());
$value = array_map(function ($item) {
return $item ?? '';
}, $value);
$value = json_encode($value);
} }
$template = $GLOBALS['template_factory']->open('forms/i18n_text_input'); $template = $GLOBALS['template_factory']->open('forms/i18n_text_input');
$template->title = $this->title; $template->title = $this->title;
......
...@@ -15,8 +15,12 @@ class I18n_textareaInput extends Input ...@@ -15,8 +15,12 @@ class I18n_textareaInput extends Input
if (!is_object($this->value)) { if (!is_object($this->value)) {
$value = $this->value; $value = $this->value;
} else { } else {
$value = [\I18NString::getDefaultLanguage() => $this->value->original()]; $value = [\I18NString::getDefaultLanguage() => $this->value->original() ?? ''];
$value = json_encode(array_merge($value, $this->value->toArray())); $value = array_merge($value, $this->value->toArray());
$value = array_map(function ($item) {
return $item ?? '';
}, $value);
$value = json_encode($value);
} }
$template = $GLOBALS['template_factory']->open('forms/i18n_textarea_input'); $template = $GLOBALS['template_factory']->open('forms/i18n_textarea_input');
$template->title = $this->title; $template->title = $this->title;
......
...@@ -258,6 +258,7 @@ STUDIP.ready(function () { ...@@ -258,6 +258,7 @@ STUDIP.ready(function () {
params.STUDIPFORM_VALIDATED = false; params.STUDIPFORM_VALIDATED = false;
params.STUDIPFORM_REDIRECTURL = f.dataset.url; params.STUDIPFORM_REDIRECTURL = f.dataset.url;
params.STUDIPFORM_INPUTS_ORDER = []; params.STUDIPFORM_INPUTS_ORDER = [];
params.STUDIPFORM_SELECTEDLANGUAGES = {};
for (let i in JSON.parse(f.dataset.inputs)) { for (let i in JSON.parse(f.dataset.inputs)) {
params.STUDIPFORM_INPUTS_ORDER.push(i); params.STUDIPFORM_INPUTS_ORDER.push(i);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment