DieSchittigs / contao-content-api-bundle

Contao JSON-API
MIT License
41 stars 9 forks source link

Fetching a page that contains form based search results #16

Open MaximKovrigovichROI opened 4 years ago

MaximKovrigovichROI commented 4 years ago

Hello my page contains a list of search results taken from submitted form data provided by https://contao.org/en/extension-list/view/efg.20020019.en.html at the web site all pages work fine,

we need to consume the page and all linked filtered search results by api so I tried approaches like /api/page?url=/alias.html /api?url=/alias.html /api/module?id=21 all lead to an error `Call to a member function row() on null

Symfony\Component\Debug\Exception\ FatalThrowableError in system/modules/efg/modules/ModuleFormdataListing.php (line 1155) $objData = $objDataStmt->execute($varKeyword); /* Prepare URL */
$strUrl = $this->generateFrontendUrl($objPage->row());
if ($strUrl == '/' || $strUrl == '//') { $strUrl = '';
} the key place here is that there is aglobal $objPage;` expected to be populated somehow, I assume by the bundle probably

P.S. I also checked a few normal pages (contain a set of image/text sections) and no issues found, api works as expected

is it possible somehow get the search results by api? thank you!

used version: dev-master