Skip to content
Snippets Groups Projects
Commit fabd562e authored by Moritz Strohm's avatar Moritz Strohm
Browse files

ResourcePropertyDefinition::__toString: check if display_name contains more...

ResourcePropertyDefinition::__toString: check if display_name contains more than just blank spaces, fixes #3196

Closes #3196

Merge request studip/studip!2163
parent 84c32d3e
No related branches found
No related tags found
No related merge requests found
...@@ -387,23 +387,6 @@ class ResourcePropertyDefinition extends SimpleORMap ...@@ -387,23 +387,6 @@ class ResourcePropertyDefinition extends SimpleORMap
public function __toString() public function __toString()
{ {
//I18N fields can be an instance of I18NString or not. return trim($this->display_name) ?: $this->name;
//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;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment