From a718104e45d56e03b4322815f16cff1d9aa9852c Mon Sep 17 00:00:00 2001 From: YvarRavy Date: Wed, 28 Jan 2026 15:16:32 +0100 Subject: [PATCH] check if method exists instead of checking type of dv --- src/Graph/GraphPrinter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 );