Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue May 6, 2022 · 4 comments

Comments

@prabha14546
Copy link

Hi,

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

@prabha14546
Copy link
Author

prabha14546 commented May 6, 2022

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;

lhridley added a commit to codementality/ui_patterns that referenced this issue May 7, 2022
@FlorentTorregrosa
Copy link
Collaborator

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
Copy link
Author

prabha14546 commented Aug 23, 2022

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

@FlorentTorregrosa
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants