aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2023-09-18 13:38:40 +0000
committerMoritz Strohm <strohm@data-quest.de>2023-09-18 13:38:40 +0000
commitfabd562e25be59011bcbf608f7556e9bb46e791e (patch)
tree046b140efd299bf2b794f31219eddf04ce2be17a /lib
parent84c32d3e43c05c92a740c5a9297c479b22f69d49 (diff)
ResourcePropertyDefinition::__toString: check if display_name contains more than just blank spaces, fixes #3196
Closes #3196 Merge request studip/studip!2163
Diffstat (limited to 'lib')
-rw-r--r--lib/models/resources/ResourcePropertyDefinition.class.php19
1 files changed, 1 insertions, 18 deletions
diff --git a/lib/models/resources/ResourcePropertyDefinition.class.php b/lib/models/resources/ResourcePropertyDefinition.class.php
index c3a84d6..23a6434 100644
--- a/lib/models/resources/ResourcePropertyDefinition.class.php
+++ b/lib/models/resources/ResourcePropertyDefinition.class.php
@@ -387,23 +387,6 @@ class ResourcePropertyDefinition extends SimpleORMap
public function __toString()
{
- //I18N fields can be an instance of I18NString or not.
- //They are I18NString instances if at least two content
- //languages are set.
- if ($this->display_name instanceof I18NString) {
- $name = $this->display_name->__toString();
- if ($name) {
- return $name;
- } else {
- return $this->name;
- }
- } elseif ($this->display_name) {
- //Only one content language is set so that the field
- //contains the text string in that language.
- return $this->display_name;
- }
- //No display name defined. We must return the name that
- //is used internally.
- return $this->name;
+ return trim($this->display_name) ?: $this->name;
}
}