Reputation: 329
In TYPO3 8.7.9 i'm working on an extension. Normally it should be possible to create records in BE and FE but it seems that the records created in BE aren't listed in the Frontend view. But if i create a record in the FE, it is only shown in the FE view, but doesn't appear in the BE. I've checked the controllers and everything seems to be fine. The list action accesses the specific repository and assigns it to the view:
public function listAction()
{
$termins = $this->terminRepository->findAll();
$this->view->assign('termins', $termins);
}
Edit: I've just checked the mysql database entries and they contain ALL 3 entries, the two i made in BE and one i made in FE, but in the FE only one appears, in the BE the other two appear. I've never experienced that kind of behaviour.
Edit2: Of course i injected the repository.
Upvotes: 0
Views: 96
Reputation: 2269
Use default value of storage pid for new records with TypoScript like
config.tx_extbase.persistence.classes.Vendorname\Kundentermine\Domain\Model\Termin.newRecordStoragePid = 1
You can add this line in a file in your extension kundentermine/ext_typoscript_setup.txt which will be loaded automaticly into root page.
Set also in your default typoscript setup
plugin.tx_kundentermine_pi.persistence.storagePid = 1
to ensure, your Vendorname\Kundentermine\Domain\Repository\TerminRepository class fetches entries from correct storage page.
Adapt vendor, extension and model name...
Se also https://docs.typo3.org/typo3cms/ExtbaseFluidBook/b-ExtbaseReference/Index.html#persistence
Upvotes: 1