DieSchittigs/contao-content-api-bundle

Wrong annotation

Closed this issue · 2 comments

emha commented

Trying to install it in contao 4.4.24 an get the following error:

[Semantical Error] The annotation "@Sensio\Bundle\FrameworkExtraBundle\Conf iguration\Route" in class DieSchittigs\ContaoContentApiBundle\Controller\Co ntentApiController does not exist, or could not be auto-loaded in /home/mal te/projects/aixterior/vendor/dieschittigs/contao-content-api/src/Controller (which is being imported from "/home/malte/projects/aixterior/vendor/diesc hittigs/contao-content-api/src/ContaoManager/../Resources/config/routing.ym l"). Make sure annotations are installed and enabled.

Seems like it has to be changed to

Symfony\Component\Routing\Annotation\Route

The annotation references the namespace of sensio/framework-extra-bundle specifically. I assume this used to be a dependency of one of the Contao core bundles up until around 4.4.24 and is not anymore. Adding it to our dependency list might do the trick, but we'll have to see if that's necessary with Symfony\Component\Routing\Annotation\Route present.

Apparently Sensio\Bundle\FrameworkExtraBundle\Configuration\Route has been deprecated in Symfony 5.2 in favor of Symfony\Component\Routing\Annotation\Route, so the latter should be used anyway.

See https://symfony.com/doc/master/bundles/SensioFrameworkExtraBundle/annotations/routing.html

It was dropped in Contao 4.4.24 for exactly that reason: contao/contao@fb16b1e

@saibotd Should I draft a PR that replaces the Route references?