Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CHAIN field support in datatables ajax API #829

Merged

Conversation

hkwi
Copy link
Contributor

@hkwi hkwi commented Apr 17, 2024

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}"
    }
}

@krabina krabina requested a review from thomas-topway-it May 4, 2024 07:59
@thomas-topway-it
Copy link
Contributor

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

Copy link
Contributor

@thomas-topway-it thomas-topway-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry for the delay, all fine

@thomas-topway-it
Copy link
Contributor

@hkwi could you please rebase the commit ? so we can merge it

@hkwi hkwi force-pushed the datatables_api_chain branch from af2fad9 to 6e7daed Compare February 4, 2025 03:06
@thomas-topway-it thomas-topway-it merged commit 616fd09 into SemanticMediaWiki:master Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants