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

Attempt to call undefined method named "serialize" of class "InsertTagResult" #7184

Closed
Toflar opened this issue May 3, 2024 · 1 comment · Fixed by #7189
Closed

Attempt to call undefined method named "serialize" of class "InsertTagResult" #7184

Toflar opened this issue May 3, 2024 · 1 comment · Fixed by #7189
Assignees
Labels
Milestone

Comments

@Toflar
Copy link
Member

Toflar commented May 3, 2024

Affected version(s)

5.3.7

Description

I'm getting the following error after trying to update a setup from 4.13 to 5.3.7:

Symfony\Component\ErrorHandler\Error\UndefinedMethodError:
Attempted to call an undefined method named "serialize" of class "Contao\CoreBundle\InsertTag\InsertTagResult".

  at vendor/contao/core-bundle/src/InsertTag/ParsedSequence.php:67
  at Contao\CoreBundle\InsertTag\ParsedSequence->serialize()
     (vendor/contao/core-bundle/src/InsertTag/InsertTagParser.php:584)
  at Contao\CoreBundle\InsertTag\InsertTagParser->handleLegacyTagsHook(object(ParsedSequence), true)
     (vendor/contao/core-bundle/src/InsertTag/InsertTagParser.php:341)
  at Contao\CoreBundle\InsertTag\InsertTagParser->executeReplace(object(ParsedSequence), true, object(OutputType))
     (vendor/contao/core-bundle/src/InsertTag/InsertTagParser.php:355)
  at Contao\CoreBundle\InsertTag\InsertTagParser->executeReplace(object(ParsedSequence), true, object(OutputType))
     (vendor/contao/core-bundle/src/InsertTag/InsertTagParser.php:133)
  at Contao\CoreBundle\InsertTag\InsertTagParser->replace('{{iflng::de}}    <a href="{{rootPageLink::{{link_url::256}}}}" class="header__logo" title="...">        <img src="{{asset::images/logo.svg}}" alt="..." width="260" height="59">    </a>{{iflng::fr}}    <a href="{{rootPageLink::{{link_url::433}}}}" class="header__logo" title="...">        <img src="{{asset::images/logo-fr.svg}}" alt="..." width="344" height="59">    </a>{{iflng::it}}    <a href="{{rootPageLink::{{link_url::95}}}}" class="header__logo" title="...">        <img src="{{asset::images/logo-it.svg}}" alt="..." width="305" height="59">    </a>{{iflng}}')
     (vendor/contao/core-bundle/contao/library/Contao/TemplateInheritance.php:153)

I think it's because of the nesting. According to the docs of ParsedSequence itself, an InsertTagResult is expected so imho this must be handled in its serialize() method then? https://github.com/contao/contao/blob/5.x/core-bundle/src/InsertTag/ParsedSequence.php#L55

/cc @ausi

@Toflar Toflar added this to the 5.3 milestone May 3, 2024
@Toflar Toflar removed the unconfirmed label May 3, 2024
@ausi ausi linked a pull request May 4, 2024 that will close this issue
@ausi ausi self-assigned this May 4, 2024
@ausi
Copy link
Member

ausi commented May 4, 2024

See #7189

@ausi ausi closed this as completed May 4, 2024
leofeyer pushed a commit that referenced this issue May 6, 2024
Description
-----------

Fixes #7184

Commits
-------

0546ab4 Fix ParsedSequence serialize() method
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants