File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 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``::
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']);
You can’t perform that action at this time.
0 commit comments