-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
[datatables] ($store) must be of type SMW\SQLStore\SQLStore, SMW\SPARQLStore\SPARQLStore given #827
Comments
Hello @simontaurus as far as I understand you are using as SPARQLStore, is that correct ? I haven't tested it directly, however I think that QueryEngineFactory (for it to work) should be a subclass of |
Thank you for your response. Correct, I'm using a SPARQLStore. |
hello @simontaurus I've checked but I need to test with a SPARQLStore and I don't have it installed right now. Is there any docker container that I can use for this purpose ? |
One option would be our docker image / compose-stack |
After doing some research on that I still do not understand in which cases SMW passes an While
So theoretically using this basestore should work, but any try to provide a public function getSearchPanes( $printRequests, $searchPanesOptions ) {
if ( !( $this->datatables->store instanceof \SMW\SQLStore\SQLStore ) ) { // we got a SPARQLStore
// $this->datatables->store = new SQLStore(); // fails, see exception
// $this->datatables->store = \SMW\Services\ServicesFactory::getInstance()->getStore(); // fails, see exception
// $this->datatables->store = \SMW\StoreFactory::getStore( "\SMW\SQLStore\SQLStore" ); // fails, see exception
// $this->datatables->store = $this->datatables->store->baseStore; // fails, private property 'baseStore'
$closure = \Closure::bind(function &(\SMW\SPARQLStore\SPARQLStore $class) { // dirty hack to access private member
return $class->baseStore;
}, null, \SMW\SPARQLStore\SPARQLStore::class);
$this->datatables->store = &$closure($this->datatables->store); // fails, see exception
}
} Exception (may indicate a dirty state on the DB due to a previous exception while playing around with some dirty hacks)
|
Setup
Issue
(@thomas-topway-it)
Sporadically pages with a datatables query throw the mentioned error, probably when a purge is executed but it's hard to reproduce
The corresponding line is now in:
SemanticResultFormats/formats/datatables/SearchPanes.php
Line 51 in 6dd7e46
Not sure in which cases QueryResult->getStore() returns
SMW\SPARQLStore\SPARQLStore
in a SPARQLStore setup.SemanticResultFormats/formats/datatables/DataTables.php
Line 510 in 6dd7e46
Workaround is to catch cases where
SMW\SPARQLStore\SPARQLStore
is givenSteps to reproduce
Expected result: No exception
Observed result: exception occurs:
The text was updated successfully, but these errors were encountered: