Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is wrong with my form?
    primarykey
    data
    text
    <p>I'm having a problem when I try to save the form's information into the database. My form doesn't seem to be valid, even after manually setting the Theater's id for every theater in the chosen Network. Here's the related part of my module's <strong>actions.class.php</strong> :</p> <p>Here's <strong>executeCreate():</strong></p> <pre><code>public function executeCreate(sfWebRequest $request) { $this-&gt;form = $this-&gt;configuration-&gt;getForm(); $this-&gt;showing = $this-&gt;form-&gt;getObject(); $this-&gt;processCreateForm($request, $this-&gt;form); $this-&gt;setTemplate('new'); } </code></pre> <p>and now <strong>processCreateForm():</strong></p> <pre><code>protected function processCreateForm(sfWebRequest $request, sfForm $form) { $form-&gt;bind($request-&gt;getParameter($form-&gt;getName()), $request-&gt;getFiles($form-&gt;getName())); $form_name = $form-&gt;getName(); $parameters = $request-&gt;getParameter($form_name); $network_id = $parameters['network_id']; $theaters_list = Doctrine_Query::create() [...] -&gt;execute(); foreach ($theaters_list as $theater) { $form-&gt;getObject()-&gt;setTheaterId($theater-&gt;theater_id); $form-&gt;bind($request-&gt;getParameter($form-&gt;getName()), $request-&gt;getFiles($form-&gt;getName())); if ($form-&gt;isValid()) { $showing = $form-&gt;save(); } else { foreach ($form-&gt;getErrorSchema()-&gt;getErrors() as $key =&gt; $error) { echo '&lt;p&gt;' . $key . ': ' . $error . '&lt;/p&gt;'; } } } $this-&gt;getUser()-&gt;setFlash('update_success', true); $this-&gt;setTemplate('new'); } </code></pre> <p>Here's the output : </p> <p><img src="https://i.stack.imgur.com/BsXUM.png" alt="Theater_id required output"></p> <p>Thank you for your help</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload