Skip to content

Commit 336023c

Browse files
committed
Fix widget _getValue pb with callable
1 parent dfafd99 commit 336023c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Ajax/semantic/widgets/base/InstanceViewer.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,18 @@ protected function _getValue($property, $index) {
121121
if ($property instanceof \ReflectionProperty) {
122122
$value = $this->_getPropertyValue($property);
123123
$propertyName = $property->getName();
124-
} elseif (\is_callable($property) && array_search($property, [
125-
"system"
126-
]) === false)
127-
$value = $property($this->instance);
124+
} elseif (\is_callable($property) && \array_search($property, ['system','date']) === false){
125+
try{
126+
$value = $property($this->instance);
127+
}catch(\Error $e){}
128+
}
128129
elseif (\is_array($property)) {
129130
$values = \array_map(function ($v) use ($index) {
130131
return $this->_getValue($v, $index);
131132
}, $property);
132-
$value = \implode("", $values);
133+
$value = \implode('', $values);
133134
} elseif (\is_string($property)) {
134-
$value = "";
135+
$value = '';
135136
if (isset($this->instance->{$property})) {
136137
$value = $this->instance->{$property};
137138
} elseif (\method_exists($this->instance, $getter = JReflection::getterName($property))) {

0 commit comments

Comments
 (0)