[TYPO3-mvc] Re: storagePid from flexform, TS, etc.
Alex Tuveri
at at uniud.it
Sat Jun 25 12:50:24 CEST 2016
I discovered that the error was generated because there is any Pid; this line was commented out:
#$query->getQuerySettings()->setStoragePageIds(array(1,2,3));
so that the error is generated.
To fetch the records dynamically for the plugin I have modified some things as follows:
CONTROLLER
added some lines:
public function listAction()
{
$data = $this->configurationManager->getContentObject()->data;
//print_r($data);
$storagePids = $data['pages'];
reading the Array $data I can retrieve the pages where the record are stored, directly form the plugin box "Record storage"
ok but at this point I should to read recursively the Pids just read; I have not any idea to how to do this
the variabile $storagePids
is passed to the Repository via Controller such as:
$normals = $this->normalRepository->findAllMinusEndtime($storagePids);
REPOSITORY
then the function can use the list (comma separated) of the pids, in this way:
$query->getQuerySettings()->setRespectStoragePage(TRUE);
$query->getQuerySettings()->setStoragePageIds(array($pages));
CONCLUSION
this works perfectly, except for the recursive behaviour
I don't know if the recursive should be set into the Controller or via query.
More information about the TYPO3-project-typo3v4mvc
mailing list