Skip to content

Parent of category can not be accessed #302

Open
@mueller-sebastian

Description

@mueller-sebastian

Bug Report

Prerequisites

  • Can you reproduce the problem on TYPO3 v9.5 LTS
  • Can you reproduce the problem on TYPO3 v10.4 LTS
  • Can you reproduce the problem on TYPO3 v11.x
  • Did you perform a cursory search to see if your bug or feature is already reported?

Description

When trying to access the parent of one single category of an post, an error occures. Category has ORM/lazy, the Category->getParent() function tries to return an lazy loading proxy object but the allowed return types are null and Category.

Steps to Reproduce

Try to access the parent of an category assigned to a blog post

        <f:for each="{post.categories}" as="category" iteration="iterator">
            {category.parent.title}
        </f:for>

Expected behavior: [What you expected to happen]
Throw no error and return parent category values

Actual behavior: [What actually happened]

(1/1) TypeError
Return value of T3G\AgencyPack\Blog\Domain\Model\Category::getParent() must be an instance of T3G\AgencyPack\Blog\Domain\Model\Category or null, instance of TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy returned

Versions

t3g/blog 12.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions