Skip to content

Commit

Permalink
Add CHAIN field support in datatables ajax API (#829)
Browse files Browse the repository at this point in the history
* Add CHAIN field support in datatables ajax API

* lint spaces
  • Loading branch information
hkwi authored Feb 4, 2025
1 parent 84525db commit 616fd09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions formats/datatables/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use ApiBase;
use ParamProcessor\ParamDefinition;
use SMW\DataValueFactory;
use SMW\DataValues\PropertyChainValue;
use SMW\Services\ServicesFactory;
use SMWPrintRequest;
use SMWQueryProcessor;
Expand Down Expand Up @@ -106,6 +107,11 @@ public function execute() {
// create property from property key
if ( $printoutData[0] === SMWPrintRequest::PRINT_PROP ) {
$data_ = $dataValueFactory->newPropertyValueByLabel( $printoutData[1] );
} elseif ( $printoutData[0] === SMWPrintRequest::PRINT_CHAIN ) {
$data_ = $dataValueFactory->newDataValueByType(
PropertyChainValue::TYPE_ID
);
$data_->setUserValue( $printoutData[1] );
} else {
$data_ = null;
if ( $hasMainlabel && trim( $parameters['mainlabel'] ) === '-' ) {
Expand Down

0 comments on commit 616fd09

Please sign in to comment.