[TYPO3-mvc] Very strange "serialize Domain Object" error

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Tue Sep 27 18:35:38 CEST 2011


Hi there

I have a very stange behaviour with one of my actions:

public function resultsAction(Tx_Myext_Domain_Model_SearchDemand $demand) {
   $paginate = new Tx_Myext_Domain_Model_Paginate();
   $paginate -> setPage($_REQUEST['page']);
   $paginate -> setRecordsPage(5);
   $paginate -> setRecordsAll(45); <<==
   //$paginate -> setRecordsAll( 
$GLOBALS["TSFE"]->fe_user->getKey("ses","recordsAll"));

   $assignments['paginate'] = $paginate;
   $assignments['demand'] = $demand;
   $assignments['entfernungs'] = 
$this->entfernungRepository->findDemanded($demand, $paginate);

   $this->view->assignMultiple($assignments);
}

When i comment out the line "$paginate -> setRecordsAll(45);" then there 
is no error.

When i leave this line, i get the error: "Could not serialize Domain 
Object Tx_Myext_Domain_Model_SearchDemand. It is neither an Entity with 
identity properties set, nor a Value Object."

Tx_Myext_Domain_Model_Paginate object method has side effects on 
Tx_Myext_Domain_Model_SearchDemand object?!? Looks to me like a bug...

On the same page i use another (prior) content plugin with this action:

public function demandAction(Tx_Myext_Domain_Model_SearchDemand $demand) {
   $recordsAll = $this->entfernungRepository->countDemanded($demand);
   $GLOBALS["TSFE"]->fe_user->setKey("ses", "recordsAll", $recordsAll);
   $this->view->assignMultiple(array('count' => $recordsAll, 'demand' => 
$demand));
}

Any help would be much appreciated!

Cheers,
Till


More information about the TYPO3-project-typo3v4mvc mailing list