php - CakePHP: Getting Validation errors for nonexistant fields -


I have some strange problems with a form in CakePHP. I am trying to save the form that I Found on the model booking Some contact data, a message, a phone number, and an email address, standard accessories. The data has been posted and I want to do this

  $ this-> booking-> I am trying to save through Save ($ this-> Request-> Data);  

But as I am trying to save, two fields do not pass verification and stop the saving process: phone_buyer and carsign .

The strange thing is that these two fields are not part of the form that I am trying to save. They are $ this-> Data do not appear in , as expected:

$ this-> request-> Data:

  array ('reservation' = & gt; , array ( 'question' = & gt; '.?. Lieber Vermieter, Ich wurde gerne im angegebenen Zeitraum auf deinem Parkplatz Parken first slave möglich ish freue Mich auf deine Rückmeldung Liebe Grüße', 'start_date' = & gt; '30. '10.2014', 'end_date' =>, '30.10.2014 ',' sellerid '=> 294', buyerid => '301', 'parkid' => 10468, status '= & gt;' Angebot ',' answer '= & gt;' Blserntesn7x6 U fcgt CC ',' ppemail_seller '= & gt;' * email * ',' phone_seller '= & gt;' +0532732123 ',' Acceptrules' = & gt; '1', 'Approved2' = & gt; '1', 'id' = & gt; '1012'))  

... and they That form Issa'm not who I submit, too. They are not in any other form on the page. Although they exist as fields in databases and the model has validation rules:

Booking.php (model):

  class bookings enhances AppModel {public $ validate = array (// (...) 'phone_seller' = & gt; array ( 'rules' = & gt; array (' notEmpty '),' message '= & gt;'. Damit dich der Mieter kontaktieren kann, brauchst du Eine Telefonnummer '),' ppemail_seller '= & gt; array (' rules '= & gt; array (' notEmpty '),' message '= & gt;' um das Geld der Miete zu empfangen, benötigst du ein PayPal -Konto. '), // These two are giving me headaches:' carsign '= & gt; array (' required '= & gt; array (' no Iam '= & gt; array (' notEmpty '),' required '= & gt; false,' message '= & gt;' Do Bracist Ann Otocentnejichen, um den Parkplat Zhu Buchen.)), 'Fon_boyr' = gt; array ( 'required' = & gt; array ( 'rules' = & gt; array (' notEmpty '),' required '= & gt; wrong,' message '= & gt;' repressed Deitch fear Waritr Kantktiiren Kannu Brunch Doe Telephone Telephoner. ')));  

}

}

But according to the documentation I've read so far, not the rules. If the relevant field is not part of the submitted form then nothing should be done. To ensure this, I have the required = & gt; False , but they still throw errors on me. I would be very happy for any help, thank you in advance :) Sorry if some things are difficult to understand, English is not my native language.

Update:

Thanks for the suggestions, I got the problem. I have written it down in a reply.

I got the problem.

The issue was that in some code before saving, $ this-> booking-> Read (); was used to obtain the contents of the database since that function has written data in the model (as I have learned), the data I was trying to save was lost and by the contents of the database Was replaced (in which these specific fields were missing) I have the function $ this-> Booking-> FindById ($ id); and everything worked fine.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -