nuvoleweb / ui_patterns

[NOTE] Development has moved to https://drupal.org/project/ui_patterns
https://drupal.org/project/ui_patterns
GNU General Public License v2.0
85 stars 56 forks source link

Undefined index: label in Drupal\ui_patterns\Definition\PatternDefinitionField->__construct() (line 41 of /var/www/html/docroot/modules/contrib/ui_patterns/src/Definition/PatternDefinitionField.php) #350

Open prabha14546 opened 2 years ago

prabha14546 commented 2 years ago

Hi,

I am getting this issue when incorrect definition in .yml file.

prabha14546 commented 2 years ago

This issue can be resolved by using below code in ui_patterns/src/Definition/PatternDefinitionField.php replace line no 37 & 38 with the below code

$name_key = !isset($value['name']) ? $name : $value['name']; $this->definition['name'] = $name_key; $this->definition['label'] = isset($value['label']) ? $value['label'] : $name_key;

FlorentTorregrosa commented 1 year ago

Hi,

Can you please provide more details about the "incorrect" definition in .yml file?

Is it the "label" of the pattern and/or the "label" of a field that is missing?

prabha14546 commented 1 year ago

Hi, $value['label'] this label index is missing in $value

FlorentTorregrosa commented 1 year ago

Hi, I understood this point. What I asked for was an example of incorrect .yml file.