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 @@ -287,7 +287,7 @@ Creating and binding an event listener to the form::
287287 // checks whether the user has chosen to display their email or not.
288288 // If the data was submitted previously, the additional value that is
289289 // included in the request variables needs to be removed.
290- if (true === $user['showEmail']) {
290+ if (isset($user['showEmail']) && $user['showEmail']) {
291291 $form->add('email', EmailType::class);
292292 } else {
293293 unset($user['email']);
@@ -383,7 +383,7 @@ Consider the following example of a form event subscriber::
383383 // checks whether the user has chosen to display their email or not.
384384 // If the data was submitted previously, the additional value that
385385 // is included in the request variables needs to be removed.
386- if (true === $user['showEmail']) {
386+ if (isset($user['showEmail']) && $user['showEmail']) {
387387 $form->add('email', EmailType::class);
388388 } else {
389389 unset($user['email']);
You can’t perform that action at this time.
0 commit comments