From b3841df1d29b743767fc271d82dd31697ec2b279 Mon Sep 17 00:00:00 2001 From: srosse <stephane.rosse@frentix.com> Date: Thu, 9 Jul 2020 11:07:37 +0200 Subject: [PATCH] OO-4782: fix NPE in single key translator for standard input field --- .../ui/SingleKeyTranslatorController.java | 2 +- .../util/resource/WindowedResourceable.java | 19 +++++++++++++++++++ .../resource/WindowedResourceableList.java | 19 +++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/olat/core/util/i18n/ui/SingleKeyTranslatorController.java b/src/main/java/org/olat/core/util/i18n/ui/SingleKeyTranslatorController.java index ddee744d569..ce329aad4ab 100644 --- a/src/main/java/org/olat/core/util/i18n/ui/SingleKeyTranslatorController.java +++ b/src/main/java/org/olat/core/util/i18n/ui/SingleKeyTranslatorController.java @@ -155,7 +155,7 @@ public class SingleKeyTranslatorController extends FormBasicController { if(textArea) { te = uifactory.addTextAreaElement(textId, null, -1, 8, 60, false, false, value, formLayout); } else { - te = uifactory.addTextElement(textId, null, null, 255, value, formLayout); + te = uifactory.addTextElement(textId, textId, null, 255, value, formLayout); te.setDisplaySize(60); } te.setMandatory(true); diff --git a/src/main/java/org/olat/core/util/resource/WindowedResourceable.java b/src/main/java/org/olat/core/util/resource/WindowedResourceable.java index c752095beee..22334126918 100644 --- a/src/main/java/org/olat/core/util/resource/WindowedResourceable.java +++ b/src/main/java/org/olat/core/util/resource/WindowedResourceable.java @@ -1,3 +1,22 @@ +/** + * <a href="http://www.openolat.org"> + * OpenOLAT - Online Learning and Training</a><br> + * <p> + * Licensed under the Apache License, Version 2.0 (the "License"); <br> + * you may not use this file except in compliance with the License.<br> + * You may obtain a copy of the License at the + * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> + * <p> + * Unless required by applicable law or agreed to in writing,<br> + * software distributed under the License is distributed on an "AS IS" BASIS, <br> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> + * See the License for the specific language governing permissions and <br> + * limitations under the License. + * <p> + * Initial code contributed and copyrighted by<br> + * frentix GmbH, http://www.frentix.com + * <p> + */ package org.olat.core.util.resource; import org.olat.core.id.OLATResourceable; diff --git a/src/main/java/org/olat/core/util/resource/WindowedResourceableList.java b/src/main/java/org/olat/core/util/resource/WindowedResourceableList.java index 5300c53c9d1..c70ded5649f 100644 --- a/src/main/java/org/olat/core/util/resource/WindowedResourceableList.java +++ b/src/main/java/org/olat/core/util/resource/WindowedResourceableList.java @@ -1,3 +1,22 @@ +/** + * <a href="http://www.openolat.org"> + * OpenOLAT - Online Learning and Training</a><br> + * <p> + * Licensed under the Apache License, Version 2.0 (the "License"); <br> + * you may not use this file except in compliance with the License.<br> + * You may obtain a copy of the License at the + * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> + * <p> + * Unless required by applicable law or agreed to in writing,<br> + * software distributed under the License is distributed on an "AS IS" BASIS, <br> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> + * See the License for the specific language governing permissions and <br> + * limitations under the License. + * <p> + * Initial code contributed and copyrighted by<br> + * frentix GmbH, http://www.frentix.com + * <p> + */ package org.olat.core.util.resource; import java.util.ArrayDeque; -- GitLab