[TYPO3-mvc] Tx_Extbase_MVC_Exception_InfiniteLoop
Claus Due
claus at wildside.dk
Tue Jan 3 17:38:03 CET 2012
I think I spotted the problem:
> <f:form.hidden property="program" value="{program.uid}" />
Should be:
> <f:form.hidden name="program" value="{program.uid}" />
Because if "property" is used the field name will be tx_myext[newOrder][program] instead of the proper tx_myext[program]. If you also need to fill the "program" property on newOrder you need both fields (or $newOrder->setProgram($program) in createAction).
Cheers,
Claus
On Jan 3, 2012, at 5:24 PM, Marc Bastian Heinrichs wrote:
> Hey,
>
> Am 29.12.11 05:23, schrieb Mark Kuiphuis:
>
>> <?php
>> class Tx_TravelPrograms_Controller_OrderController extends
>> Tx_Extbase_MVC_Controller_ActionController {
>>
>>
>> /*
>> * Displays a form for creating a new order
>> *
>> * @param Tx_TravelPrograms_Domain_Model_Program $program The selected program
>> * @param Tx_TravelPrograms_Domain_Model_Order $newOrder The new order object
>> * @dontvalidate $newOrder
>> * @return string An HTML form for creating a new order
>> */
>> public function newAction(Tx_TravelPrograms_Domain_Model_Program $program,
>> Tx_TravelPrograms_Domain_Model_Order $newOrder = NULL) {
>>
>> $referrals = $this->referralRepository->findAllReferrals();
>>
>> $this->view->assign('program', $program);
>> $this->view->assign('newOrder', $newOrder);
>> $this->view->assign('referrals', $referrals);
>> }
>>
>> /*
>> * @param Tx_TravelPrograms_Domain_Model_Program $program The selected program
>> * @param Tx_TravelPrograms_Domain_Model_Order $newOrder A fresh newOrder object
>> which has not been added to the repository yet
>> * @return void
>> */
>> public function createAction(Tx_TravelPrograms_Domain_Model_Program $program,
>> Tx_TravelPrograms_Domain_Model_Order $newOrder) {
>> $this->orderRepository->add($newOrder);
>> $this->redirect('show');
>> }
>>
>> }
>> ?>
>>
>> The @dontvalidate $newOrder is there, but I keep on getting this 101 infinite loop error
>>
>> The fluid form looks like this:
>>
>> <f:flashMessages />
>>
>> <f:form action="create" name="newOrder" object="{newOrder}" noCacheHash="true">
>> <div>
>> <f:form.hidden property="program" value="{program.uid}" />
>> <f:form.hidden property="price" value="{program.price}" />
>> </div>
>> <div class="flabel">
>> <label for="name"><f:translate key="name" /></label>
>> </div>
>> <div class="field"><f:form.textbox property="name" size="50" /></div>
>>
>> <div class="clear"></div>
>>
>> <div class="flabel">
>> <label for="address"><f:translate key="address" /></label>
>> </div>
>> <div class="field"><f:form.textbox property="address" size="50" /></div>
>>
>> <div class="clear"></div>
>>
>> <div class="flabel">
>> <label for="postcode"><f:translate key="postcode" /></label>
>> </div>
>> <div class="field"><f:form.textbox property="postcode" size="10" /></div>
>>
>> <div class="clear"></div>
>>
>> <div class="flabel">
>> <label for="city"><f:translate key="city" /></label>
>> </div>
>> <div class="field"><f:form.textbox property="city" size="50" /></div>
>>
>> <div class="clear"></div>
>>
>> <div class="flabel">
>> <label for="email"><f:translate key="email" /></label>
>> </div>
>> <div class="field"><f:form.textbox property="email" size="50" /></div>
>>
>> <div class="clear"></div>
>>
>> <!-- div class="flabel">
>> <label for="newsletter"><f:translate key="newsletter" /></label>
>> </div>
>> <div class="field"><f:form.checkbox property="newsletter" value="0" /> <f:translate
>> key="newsletter_info" /></div -->
>>
>> <div class="clear"></div>
>>
>> <div class="flabel">
>> <label for="referral"><f:translate key="referral" /></label>
>> </div>
>> <div class="field"><f:form.select property="referral" options="{referrals}"
>> optionValueField="uid" optionLabelField="title" /></div>
>>
>> <div class="clear"></div>
>>
>> <fieldset class="payment-methods">
>> <legend><f:translate key="paymentTypes" /></legend>
>> <div class="field">
>> <f:form.radio class="radio" property="paymentType" value="1"
>> checked="{payment.paymentType} == 1" /> <f:translate key="paymentType_Ideal" /><br/>
>> <f:form.radio class="radio" property="paymentType" value="2"
>> checked="{payment.paymentType} == 2" /> <f:translate key="paymentType_BankTransfer"
>> /><br/>
>> </div>
>> </fieldset>
>>
>> <div class="clear"></div>
>>
>> <!-- div class="flabel"></div>
>> <div class="field">
>> <div style="float: left; margin-right: 5px;"><f:form.checkbox property="terms"
>> value="1" /></div> <label for="terms-conditions"><f:translate key="terms-conditions"
>> /></label>
>> </div>
>> <div class="field"><f:translate key="terms_info" /></div -->
>>
>> <div class="clear"></div>
>>
>> <f:form.submit class="submit" value="{f:translate(key: 'submit_order')}" />
>> </f:form>
>
> Where is the form field forwarding the program uid for mapping the
> action argument $program in createAction? This is an required argument.
> Perhaps here is error. Did you configured devIPmask correct, that you
> can see a thrown exceptions in detail?
>
> Best
> Marc Bastian
>
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list