diff --git a/lib/models/resources/ResourcePropertyDefinition.class.php b/lib/models/resources/ResourcePropertyDefinition.class.php index 37fa89b95d3bed5133a3a2ec56e93809e4194104..108f7e16b66fd95440d0077aa4a934afaa8b7cfc 100644 --- a/lib/models/resources/ResourcePropertyDefinition.class.php +++ b/lib/models/resources/ResourcePropertyDefinition.class.php @@ -382,23 +382,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; } }