File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ method of the ``FormFactory``::
283
283
// checks whether the user has chosen to display their email or not.
284
284
// If the data was submitted previously, the additional value that is
285
285
// included in the request variables needs to be removed.
286
- if (true === $user['showEmail']) {
286
+ if (isset($user['showEmail']) && $user['showEmail']) {
287
287
$form->add('email', EmailType::class);
288
288
} else {
289
289
unset($user['email']);
@@ -379,7 +379,7 @@ Consider the following example of a form event subscriber::
379
379
// checks whether the user has chosen to display their email or not.
380
380
// If the data was submitted previously, the additional value that
381
381
// is included in the request variables needs to be removed.
382
- if (true === $user['showEmail']) {
382
+ if (isset($user['showEmail']) && $user['showEmail']) {
383
383
$form->add('email', EmailType::class);
384
384
} else {
385
385
unset($user['email']);
You can’t perform that action at this time.
0 commit comments