Closed (fixed)
Project:
YAML Form
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Mar 2016 at 20:09 UTC
Updated:
8 Apr 2016 at 02:24 UTC
Jump to comment: Most recent
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Element!Ma...
Below YAML markup is not working as expected...
label:
'#type': textfield
'#title': 'Label'
machine_name:
'#type': machine_name
'#title': 'Machine name'
'#machine_name':
source: label
and throws...
Fatal error: Cannot use string offset as an array in /private/var/www/sites/d8_dev/core/lib/Drupal/Core/Form/FormBuilder.php on line 1011
Comments
Comment #3
jrockowitz commentedThere is now the below working example for a machine name element with a label included in the 'Inputs: Examples'
Please note, the
$form['machine_name']['#machine_name']['source']array must match the parent element names.