The following notice pops up when I try to create a new user:

Notice: Undefined index: user_picture in Drupal\Core\Entity\EntityFormController->submitEntityLanguage() (line 438 of core/lib/Drupal/Core/Entity/EntityFormController.php).

When doing this, I'm logged in as user 1.

When I look into the code I see the following statement:

$previous_langcode = $form[$field_name]['#language'];

I guess the index "user_picture" isn't present in the array $form. Should we introduce an isset() to check if the index is present in the array?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcingy’s picture

Assigned: Unassigned » marcingy

This only happens when we use the standard install and infact we get another notice when on php 5.4 which I will create another issue for.

marcingy’s picture

Status: Active » Needs review
FileSize
2.04 KB

Test added to find the notice. This will fail.

marcingy’s picture

FileSize
3.21 KB

And now the patch

marcingy’s picture

FileSize
3.6 KB

Meh must save before creating patch

alexpott’s picture

Status: Needs review » Needs work
Issue tags: +D8MI

Manually tested and the simpletest looks good.

Minor nit...

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.phpundefined
@@ -14,6 +14,15 @@
+  /**
+   * Modules to enable.
+   *
+   * Enable dummy module that implements hook_node_insert() for exceptions.
+   *
+   * @var array
+   */

The comment here doesn't look right...

marcingy’s picture

Status: Needs work » Needs review
FileSize
3.51 KB

Comment cleaned up.

jessebeach’s picture

Status: Needs review » Reviewed & tested by the community

I just ran into this issue. Tested the patch and it removes the error. The code looks sensible. Setting to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed a7ef6f3 and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.