fixtures suck
This commit is contained in:
@@ -13,7 +13,7 @@ use Cake\ORM\Entity;
|
||||
* @property string $client_ip
|
||||
* @property string $name
|
||||
* @property string|null $email
|
||||
* @property string|null $subject
|
||||
* @property string|null $contact_subject
|
||||
* @property string $message
|
||||
* @property \Cake\I18n\DateTime|null $confirm_email_sent
|
||||
* @property \Cake\I18n\DateTime|null $backend_email_sent
|
||||
@@ -34,7 +34,7 @@ class ContactUsFormSubmission extends Entity {
|
||||
'client_ip' => true,
|
||||
'name' => true,
|
||||
'email' => true,
|
||||
'subject' => true,
|
||||
'contact_subject' => true,
|
||||
'message' => true,
|
||||
'confirm_email_sent' => true,
|
||||
'backend_email_sent' => true,
|
||||
|
||||
@@ -82,14 +82,14 @@ class ContactUsFormSubmissionsTable extends Table {
|
||||
$validator->allowEmptyString('email');
|
||||
}
|
||||
|
||||
// subject
|
||||
// contact_subject
|
||||
$validator
|
||||
->scalar('subject')
|
||||
->maxLength('subject', 255);
|
||||
->scalar('contact_subject')
|
||||
->maxLength('contact_subject', 255);
|
||||
if ($fields['subject'] ?? false) {
|
||||
$validator->notEmptyString('subject');
|
||||
$validator->notEmptyString('contact_subject');
|
||||
} else {
|
||||
$validator->allowEmptyString('subject');
|
||||
$validator->allowEmptyString('contact_subject');
|
||||
}
|
||||
|
||||
$validator
|
||||
|
||||
Reference in New Issue
Block a user