Skip to content

Commit e901fbb

Browse files
1.1.9
[FIXED] Fall back to searching for records on current page if no storagePid is set
1 parent 7ecb9e0 commit e901fbb

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

Classes/Controller/JnPHPContentController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function injectJnPhpContentRepository(\Joppnet\JnPhpcontentelement\Domain
4040
*/
4141
public function listAction()
4242
{
43-
// \TYPO3\CMS\Core\Utility\DebugUtility::debug($this->jnPhpContentRepository->findAll());
4443
$jnPhpContents = $this->jnPhpContentRepository->findAll();
4544
$this->view->assign('jnPhpContents', $jnPhpContents);
4645
}

Classes/Domain/Repository/JnPHPContentRepository.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
*/
1818
class JnPhpContentRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
1919
{
20-
public function initializeObject()
21-
{
22-
/** @var $defaultQuerySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */
23-
$defaultQuerySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
24-
$defaultQuerySettings->setRespectStoragePage(true);
25-
}
20+
public function findAll()
21+
{
22+
$query = $this->createQuery();
23+
$storagePageIds = $query->getQuerySettings()->getStoragePageIds();
24+
if (is_array($storagePageIds) && array_search(0, $storagePageIds) !== false) {
25+
$query->getQuerySettings()->setStoragePageIds([$GLOBALS['TSFE']->id]);
26+
}
27+
return $query->execute();
28+
}
2629
}

Configuration/TypoScript/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugin.tx_jnphpcontentelement_phpcelist {
99
layoutRootPaths.1 = {$plugin.tx_jnphpcontentelement_phpcelist.view.layoutRootPath}
1010
}
1111
persistence {
12-
storagePid >
12+
#storagePid = {$plugin.tx_jnphpcontentelement_phpcelist.persistence.storagePid}
1313
#recursive = 1
1414
}
1515
features {

ext_emconf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'title' => '[joppnet] PHP Content Elements',
1515
'description' => 'PHP content elements via frontend plugin.',
1616
'category' => 'plugin',
17-
'version' => '1.1.8',
17+
'version' => '1.1.9',
1818
'state' => 'stable',
1919
'uploadfolder' => false,
2020
'clearcacheonload' => true,

0 commit comments

Comments
 (0)