Prestashop: Final Class Lang generate Compile Error for the Proxy Doctrine Class

Created on 18 Oct 2019  路  3Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

Why using a FINAL class on the PrestaShopBundle\Entity\Lang class ?

When i get an attribute group name with doctrine i see this exception :

Compile Error: Class Proxies\__CG__\PrestaShopBundle\Entity\Lang may not inherit from final class (PrestaShopBundle\Entity\Lang)

The doctrine proxy classes use the inheritance of entity class

To Reproduce

        $em = $this->getDoctrine()->getManager();
        $groups = $em->getRepository(AttributeGroup::class)->findAll();
        var_dump($groups[0]->getAttributeGroupLangs()->first()->getPublicname());

Additional information
PrestaShop version: 1.7.6.1
PHP version: 7.1

1.7.6.0 1.7.6.1 Bug CO Fixed Minor PR available Regression

Most helpful comment

Woups you're absolutely right I shouldn't have added this 馃槄 I'm making a PR to fix this in the next patch version

All 3 comments

Hi @Fabuloops,

Thanks for your report.
Ping @jolelievre what do you think?
https://github.com/PrestaShop/PrestaShop/blob/develop/src/PrestaShopBundle/Entity/Lang.php#L37
It is added by this PR:
https://github.com/PrestaShop/PrestaShop/pull/13481

Thanks!

Woups you're absolutely right I shouldn't have added this 馃槄 I'm making a PR to fix this in the next patch version

Thanks for the report @Fabuloops

Was this page helpful?
0 / 5 - 0 ratings