diff --git a/src/Graph/GraphPrinter.php b/src/Graph/GraphPrinter.php index b78b0f129..2d345e38d 100644 --- a/src/Graph/GraphPrinter.php +++ b/src/Graph/GraphPrinter.php @@ -214,10 +214,10 @@ protected function processResultRow( array $row ) { while ( ( $object = $result_array->getNextDataValue() ) !== false ) { $hasProperty = $object->getProperty(); - if ( $object instanceof \SMW\DataValues\StringValue ) { - $objectText = $object->getShortWikiText(); - } else { + if ( method_exists( $object, 'getDisplayTitle' ) ) { $objectText = $object->getDisplayTitle(); + } else { + $objectText = $object->getShortWikiText(); } $includeAsEdge = !$showGraphFields || $isPageType || $request->isMode( PrintRequest::PRINT_CHAIN );