SemanticMediaWiki / SemanticResultFormats

Provides additional visualizations (result formats) for Semantic MediaWiki
https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Result_Formats
Other
45 stars 75 forks source link

Add CHAIN field support in datatables ajax API #829

Open hkwi opened 2 months ago

hkwi commented 2 months ago

How to reproduce

Create a page with following content

{{#subobject: A |Text=A }}
{{#subobject: B |Text=B }}
{{#subobject: C |Text=C }}
{{#ask:
[[-Has subobject::{{FULLPAGENAME}}]]
|?Has subobject.Text
|format=datatables
|datatables-pageLength=2
|limit=1
}}

When SMW renders the page, Processing... and Loading... stays displayed.

image

Following is the response from api action=ext.srf.datatables.api, in browser devtool.

{
    "error": {
        "code": "internal_api_error_InvalidArgumentException",
        "info": "[3f28f227f0de38a93bb53121] Exception caught: Data provided for print request does not fit the type of printout.",
        "errorclass": "InvalidArgumentException",
        "*": "InvalidArgumentException at /var/www/html/extensions/SemanticMediaWiki/src/Query/PrintRequest.php(98)\nfrom /var/www/html/extensions/SemanticMediaWiki/src/Query/PrintRequest.php(98)\n#0 /var/www/html/extensions/SemanticResultFormats/formats/datatables/Api.php(124): SMW\\Query\\PrintRequest->__construct(integer, string, NULL, string, array)\n#1 /var/www/html/includes/api/ApiMain.php(1907): SRF\\DataTables\\Api->execute()\n#2 /var/www/html/includes/api/ApiMain.php(884): ApiMain->executeAction()\n#3 /var/www/html/includes/api/ApiMain.php(855): ApiMain->executeActionWithErrorHandling()\n#4 /var/www/html/api.php(91): ApiMain->execute()\n#5 /var/www/html/api.php(46): wfApiMain()\n#6 {main}"
    }
}
thomas-topway-it commented 2 months ago

@hkwi Hiroaki, I'm sorry for the delay, could you please add in the description an easy setup for testing ? thanks a lot