On saving values in a machine name field through the widget, I get the following notices:

Notice: Undefined index: exists in Drupal\Core\Render\Element\MachineName::validateMachineName() (line 245 of core/lib/Drupal/Core/Render/Element/MachineName.php).
Drupal\Core\Render\Element\MachineName::validateMachineName(Array, Object, Array)

Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in Drupal\Core\Render\Element\MachineName::validateMachineName() (line 246 of core/lib/Drupal/Core/Render/Element/MachineName.php).

Patch to follow.

Comments

james.williams created an issue. See original summary.

james.williams’s picture

Patch :-)

welly’s picture

Status: Active » Reviewed & tested by the community

Hi James,

Thanks for the patch, just tested it and works well. Cheers!

+1 to merge

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: machine_name-php_notice_on_saving-2824694-2.patch, failed testing.

The last submitted patch, 2: machine_name-php_notice_on_saving-2824694-2.patch, failed testing.

welly’s picture

Added a test (more tests to come)

welly’s picture

Status: Needs work » Needs review

  • C_Logemann committed 6a27d89 on 8.x-1.x authored by james.williams
    Issue #2824694 by james.williams, welly: PHP notice on saving machine...
  • C_Logemann committed e029f3d on 8.x-1.x authored by welly
    Issue #2824694 by james.williams, welly: PHP notice on saving machine...
c-logemann’s picture

Status: Needs review » Fixed
Issue tags: +dcmuc16

@welly: thanx for adding a test. And more test would be fine.

I did an own commit for the test part of the patch to address authorship for you and james.williams separately.

(The "dcmuc16"-tag is because I'm currently working on drupalcamp munich codesprint)

Status: Fixed » Closed (fixed)

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