Skip to content

Commit 20b12ad

Browse files
committed
Merge pull request #824 from LearningLocker/issue/823
Fixes issue with displaying the object for Groups in the statements page
2 parents 97ebfc7 + f153dbb commit 20b12ad

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/views/partials/statements/item.blade.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
//set object for display
5050
5151
//is the object of type agent?
52-
if( isset($statement['object']['objectType']) && $statement['object']['objectType'] == 'Agent' ){
52+
if( isset($statement['object']['objectType']) && ($statement['object']['objectType'] == 'Agent' || $statement['object']['objectType'] == 'Group') ){
5353
if( isset($statement['object']['name']) ){
5454
$object = $statement['object']['name'];
5555
}else{
56-
$object = isset($statement['object']['mbox']) ? $statement['object']['mbox'] : 'no name available';
56+
$object = isset($statement['object']['mbox']) ? $statement['object']['mbox'] : $statement['object']['objectType'];
5757
}
5858
}elseif( isset($statement['object']['objectType']) && $statement['object']['objectType'] == 'SubStatement' ){
5959
$object = 'A SubStatement'; //@todo not sure how to handle substatement display?
@@ -73,9 +73,11 @@
7373
$object = [$object];
7474
}
7575
$object = reset( $object );
76-
}else{
76+
} elseif (isset($statement['object']['id'])) {
7777
//last resort, or in the case of statement ref, use the id
7878
$object = $statement['object']['id'];
79+
} else {
80+
$object = "Unnamed Object";
7981
}
8082
}
8183

0 commit comments

Comments
 (0)