8000 Receiving `Attempted to call an undefined method named "getVarName"` when upgrading to the latest `7.2.*` version · Issue #58702 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Receiving Attempted to call an undefined method named "getVarName" when upgrading to the latest 7.2.* version #58702
Closed
@pan93412

Description

@pan93412

Symfony version(s) affected

7.2 (91588b3)

Description

getVarName only appears on 7.1, and replaced with constant in 7.2:

private function getVarName(): string
{
return sprintf('__internal_%s', hash('xxh128', uniqid(mt_rand(), true)));
}

The 7.2 TranslationDefaultDomainNodeVisitor references getVarName, which does not exist in version 7.2:

This issue appears to stem from a mistakenly ahead porting by @nicolas-grekas. I'm unsure if it is safe to reference INTERNAL_VAR_NAME in this context.

private const INTERNAL_VAR_NAME = '__internal_trans_default_domain';

How to reproduce

  1. Clone https://github.com/database-playground/app-sf/tree/def0e92908d3eaadf41802142742a4d8b5e3f2b0
  2. Run composer update
  3. It throws Attempted to call an undefined method named "getVarName" of class "Symfony\Bridge\Twig \NodeVisitor\TranslationDefaultDomainNodeVisitor".

Possible Solution

Change getVarName to INTERNAL_VAR_NAME.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0