Skip to content

Commit 2fa5fa3

Browse files
committed
Merge branch '3.4' into 4.3
* 3.4: Remove strict true === $user['showEmail'] on preSubmit
2 parents 1a9872c + a728c69 commit 2fa5fa3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

form/events.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ method of the ``FormFactory``::
283283
// checks whether the user has chosen to display their email or not.
284284
// If the data was submitted previously, the additional value that is
285285
// included in the request variables needs to be removed.
286-
if (true === $user['showEmail']) {
286+
if (isset($user['showEmail']) && $user['showEmail']) {
287287
$form->add('email', EmailType::class);
288288
} else {
289289
unset($user['email']);
@@ -379,7 +379,7 @@ Consider the following example of a form event subscriber::
379379
// checks whether the user has chosen to display their email or not.
380380
// If the data was submitted previously, the additional value that
381381
// is included in the request variables needs to be removed.
382-
if (true === $user['showEmail']) {
382+
if (isset($user['showEmail']) && $user['showEmail']) {
383383
$form->add('email', EmailType::class);
384384
} else {
385385
unset($user['email']);

0 commit comments

Comments
 (0)