[TYPO3-mvc] more than one repository in one controller without output of data
Alex Tuveri
at at uniud.it
Fri Jun 17 13:54:36 CEST 2016
Hi this is strange,
and I suspect that the solution depends on the fact that repositories and controllers are not linked.
To simplify I will describe here two tables that are independent each other (not relationated):
Normal
Holidays
I am developing an extension, so that I added a new field for the BE working on:
Configuration/TCA/Holidays etc. is configured OK; BE works great and I can fill the data;
DB is ok and the table is filled out corrected with the value desired.
OK there is the controller (Normal) where I attempt to retrieve data from a query. So the file
Classes/Controller/NormalController.php
contains the vars to inject the repository, then I have:
/**
* holidayRepository
*
* @var \Specialistaweb\Soho\Domain\Repository\HolidayRepository
* @inject
*/
protected $holidayRepository = NULL;
and when the action is triggered, this is the code:
//$normals = $this->normalRepository->getLastNormal();
$normals = $this->normalRepository->findAll();
$this->view->assign('normals', $normals);
$holidayh = $this->holidayRepository->findAll();
$this->view->assign('holidayh', $holidayh);
Infact I need to fill the view normals/List.htm
with different data fetched from the tables: normal and holiday
all works fine, but a field cannot be rendered anyway.
I enabled the debug to get some data for persistence, here is the output:
TYPO3\CMS\Extbase\Persistence\Generic\QueryResultprototypeobject (2 items)
0 => Specialistaweb\Soho\Domain\Model\Holidayprototypepersistent entity (uid=1, pid=1)
name => 'santo Natale' (12 chars)
text => 'oggi e' il ss. Natale' (21 chars)
holidaydate => '1466114400' (10 chars)
uid => 1 (integer)
_localizedUid => 1 (integer)modified
_languageUid => -1 (integer)modified
_versionedUid => 1 (integer)modified
pid => 1 (integer)
(...)
as you can see the field holidaydate is filled correctly
in the view, however name and text fields appears correctly, but there is no way to fetch holidaydate field.
Here is an exceprt from the view:
<f:if condition="{holidayh}">
<h3>Holiday</h3>
<f:debug title="Results of customers query">{holidayh}</f:debug>
<f:for each="{holidayh}" as="holiday">
{holiday.holidaydate} - {holiday.pid} {holiday.holidaydate} {holiday.$
</f:for>
</f:if>
{holiday.holidaydate} doesn't appears
instead:
{holiday.pid} works correctly
any ideas? thank you very much for your help
More information about the TYPO3-project-typo3v4mvc
mailing list