Problem/Motivation

Installing the module with Drupal 11 causes an error when accessing the following page: /admin/reports/ui-components.

The website encountered an unexpected error. Try again later.

LogicException: Attribute "name" does not exist for Node "Twig\Node\Expression\GetAttrExpression". in Twig\Node\Node->getAttribute() (line 158 of /var/www/html/vendor/twig/twig/src/Node/Node.php).
Drupal\sdc_devel\Plugin\TwigValidatorRule\TwigValidatorRuleNode->checkIfVariableName() (Line: 69)
Drupal\sdc_devel\Plugin\TwigValidatorRule\TwigValidatorRuleNode->processNode() (Line: 43)
Drupal\sdc_devel\TwigValidator\TwigRulePluginVisitor->enterNode() (Line: 62)
Twig\NodeTraverser->traverseForVisitor() (Line: 65)
Twig\NodeTraverser->traverseForVisitor() (Line: 65)
Twig\NodeTraverser->traverseForVisitor() (Line: 65)
Twig\NodeTraverser->traverseForVisitor() (Line: 65)
Twig\NodeTraverser->traverseForVisitor() (Line: 65)
Twig\NodeTraverser->traverseForVisitor() (Line: 53)
Twig\NodeTraverser->traverse() (Line: 136)
Drupal\sdc_devel\TwigValidator\TwigValidator->processSource() (Line: 74)
Drupal\sdc_devel\TwigValidator\TwigValidator->validateComponent() (Line: 45)
Drupal\sdc_devel\Validator->validateComponent() (Line: 37)
Drupal\sdc_devel\Validator->validate() (Line: 212)
Drupal\sdc_devel\Controller\ComponentValidatorOverview->getComponentMessages() (Line: 111)
Drupal\sdc_devel\Controller\ComponentValidatorOverview->overview()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 53)
Asm89\Stack\Cors->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Proposed resolution

Update the checkIfVariableName function to verify whether the attribute exists or not.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#4 3509096-4.patch815 bytesqusai taha
#2 3509096-2.patch1.16 KBqusai taha

Issue fork sdc_devel-3509096

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

qusai taha created an issue. See original summary.

qusai taha’s picture

Assigned: qusai taha » Unassigned
Status: Active » Needs review
StatusFileSize
new1.16 KB

qusai taha’s picture

StatusFileSize
new815 bytes

Update the patch to fix issue with storybook as well

doxigo’s picture

Have the same issue, the patch didn't work though

mogtofu33 changed the visibility of the branch 3509096-fix-issue-logicexception to hidden.

mogtofu33’s picture

Not sure why but my push created a new branch. Issue work on mr 6.

But I cannot reproduce and it could be related to Twig version that changed from 11.1.1 to >11.1.2, so it's a blind fix on 1.0.x, let me know if there is still an issue.

mogtofu33’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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