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

Impossible to access an attribute ("id") on a null variable. #475

Closed
RubenColpaert opened this issue Sep 27, 2023 · 2 comments
Closed

Impossible to access an attribute ("id") on a null variable. #475

RubenColpaert opened this issue Sep 27, 2023 · 2 comments
Assignees

Comments

@RubenColpaert
Copy link

RubenColpaert commented Sep 27, 2023

I receive the following error when going to the orders overview and trying to create a new order.

Twig\Error\RuntimeError: Impossible to access an attribute ("id") on a null variable. in /var/www/html/htdocs/vendor/acclaro/translations/src/templates/orders/_detail.twig:173
Stack trace:
#0 /var/www/html/htdocs/vendor/craftcms/cms/src/helpers/Template.php(129): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig\Source), NULL, 'id', Array, 'any', false, false)
#1 /var/www/html/htdocs/storage/runtime/compiled_templates/ec/ecdb6797b833f55ce90fbe204a9e5028.php(90): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), NULL, 'id', Array)
#2 /var/www/html/htdocs/vendor/twig/twig/src/Template.php(394): __TwigTemplate_70649076f286a0fef9905717046e1c28->doDisplay(Array, Array)
#3 /var/www/html/htdocs/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#4 /var/www/html/htdocs/vendor/twig/twig/src/Template.php(379): Twig\Template->display(Array)
#5 /var/www/html/htdocs/vendor/twig/twig/src/TemplateWrapper.php(40): Twig\Template->render(Array, Array)
#6 /var/www/html/htdocs/vendor/twig/twig/src/Environment.php(277): Twig\TemplateWrapper->render(Array)
#7 /var/www/html/htdocs/vendor/craftcms/cms/src/web/View.php(474): Twig\Environment->render('translations/or...', Array)
#8 /var/www/html/htdocs/vendor/craftcms/cms/src/web/View.php(527): craft\web\View->renderTemplate('translations/or...', Array)
#9 /var/www/html/htdocs/vendor/craftcms/cms/src/web/TemplateResponseFormatter.php(56): craft\web\View->renderPageTemplate('translations/or...', Array, 'cp')
#10 /var/www/html/htdocs/vendor/yiisoft/yii2/web/Response.php(1100): craft\web\TemplateResponseFormatter->format(Object(craft\web\Response))
#11 /var/www/html/htdocs/vendor/craftcms/cms/src/web/Response.php(337): yii\web\Response->prepare()
#12 /var/www/html/htdocs/vendor/yiisoft/yii2/web/Response.php(340): craft\web\Response->prepare()
#13 /var/www/html/htdocs/vendor/yiisoft/yii2/base/Application.php(390): yii\web\Response->send()
#14 /var/www/html/htdocs/web/index.php(15): yii\base\Application->run()
#15 {main}

For now I overcome this with a patch by updating the line
https://github.com/AcclaroInc/craft-translations/blob/master/src/templates/orders/_detail.twig#L173
with

    tagGroupId: tagGroup ? tagGroup.id : null,
@shnsumit shnsumit self-assigned this Sep 27, 2023
@shnsumit
Copy link
Collaborator

@RubenColpaert
Thank you for bringing this issue to our attention.

It appears that this issue is related to an edge-case scenario, specifically involving the deletion of the auto-created Craft Translation Tag group, which our code relies on for the tag flow during the order creation process.
Craft settings -> Content -> Tags

image

We will take steps to handle this error more effectively in our upcoming hotfix release. You can expect the issue to be addressed and resolved in the near future.

@shnsumit
Copy link
Collaborator

Resolved in Release/3.3.1

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