Problem/Motivation

The machine_name field type tries to access a exists element on its render array to ensure the machine_name is unique. However, this value is not provided by the ScopeForm.

Steps to reproduce

  1. Ensure error reporting is enabled.
  2. Create a new OAuth server
  3. Create a new scope

An error will be shown.

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

Drupal\Core\Render\Element\MachineName::validateMachineName(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 280)

Proposed resolution

Use [$this->storage, 'load'] similar to the other forms.

User interface changes

None

API changes

None

Data model changes

None

Comments

Kingdutch created an issue. See original summary.

kingdutch’s picture

Assigned: kingdutch » Unassigned
Status: Active » Needs review
StatusFileSize
new573 bytes
sanduhrs’s picture

StatusFileSize
new386 bytes
sanduhrs’s picture

StatusFileSize
new516 bytes

  • sanduhrs committed 16c6d88 on 2.0.x
    Issue #3174092 by sanduhrs, Kingdutch: machine_name element requires '...

  • sanduhrs committed c4806f2 on 8.x-1.x
    Issue #3174092 by sanduhrs, Kingdutch: machine_name element requires '...
sanduhrs’s picture

Status: Needs review » Fixed

Thanks for the patch!

Status: Fixed » Closed (fixed)

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