[TYPO3-mvc] Tx_Extbase_MVC_Exception_InfiniteLoop

Mark Kuiphuis spam at markyourweb.com
Wed Jan 4 00:20:25 CET 2012


On 4/01/12 2:57 AM, Claus Due wrote:
> On Jan 3, 2012, at 5:51 PM, Marc Bastian Heinrichs wrote:
>
>> Tx_TravelPrograms_Domain_Model_Order has a property program.
>
> Then I suppose both fields, name and property, should be present - or {program: program.uid} in should be put in arguments attribute on f:form.
>
> Cheers,
> Claus

Hi all,

First of all I would like to thank everyone who has contributed and help me a lot in 
getting the extension closer to a finish :-) I couldn't have done it without you...

I also would like to apologize for the early (or late) replies to your answers. A 
couple of years ago that would not have been the case when I was still living in 
Europe, but 9 timezones further to the east all causes this....(it's great here 
though :D)

Anyway back to the "challenge"...

Over the hours after I sent my last reply I changed the createAction to look like this:

/*
  * @param Tx_TravelPrograms_Domain_Model_Order $order A fresh order object which has 
not been added to the repository yet
  * @return void
  */
public function createAction(Tx_TravelPrograms_Domain_Model_Order $order) {
	$program = $this->programRepository->findByUid($order->getProgram());
	$order->setPrice($program->getPrice());
	$this->orderRepository->add($order);

	$persistenceManager = t3lib_div::makeInstance('Tx_Extbase_Persistence_Manager');
	/* @var $persistenceManager Tx_Extbase_Persistence_Manager */
	$persistenceManager->persistAll();
			
	$args =  $this->request->getArguments();
	$paymentType = $args['order']['paymentType'];

	switch($paymentType) {
		case 1: {
				$this->forward('ideal', NULL, NULL, array('order' => $order));
			break;
		}
		default: {
			$this->forward('transfer', NULL, NULL, array('order' => $order));
			break;
		}
	}
}

So, in the first line I do retrieve the $program object which I need to store the 
order. (This order is a simple order as in that you can only order one product at a 
time....the product is a "travel program", that's why I added the program uid and 
program price to the order (price for historic reasons if the price of the program is 
going to be changed in the future).

Saving the form when there are no validation errors works fine....(for now and I'll 
try not to break things :D)...

Getting the checkboxes and radio buttons to prefill when validation fails however 
not.....

Cheers, Mark


More information about the TYPO3-project-typo3v4mvc mailing list