- Issue created by @recrit
- Status changed to Needs review
5 months ago 11:11pm 28 August 2024 - πΊπΈUnited States recrit
Proposed Solution:
Update "drupal-rector/src/Drupal10/Rector/Deprecation/AnnotationToAttributeRector.php" with the following to detect single argument plugins with a missing key.
The patch attached forpalantirnet/drupal-rector
applies the following update:/** * @param array|ArrayItemNode[] $parsedArgs * * @return Attribute */ private function createAttribute(string $attributeClass, array $parsedArgs): Attribute { $fullyQualified = new FullyQualified($attributeClass); // Support attributes with a single value constructor. // For example: '@ViewsField("my_custom_views_field")'. if (count($parsedArgs) === 1 && empty($parsedArgs[0]->key)) { $parsedArgs[0]->key = 'id'; } $args = []; ...