sonata-project / SonataMediaBundle

Symfony SonataMediaBundle
https://docs.sonata-project.org/projects/SonataMediaBundle
MIT License
451 stars 495 forks source link

The annotation "@ApiDoc" in method Sonata\MediaBundle\Controller\Api\GalleryController::getGalleriesAction() was never imported. #876

Closed cacahouwete closed 9 years ago

cacahouwete commented 9 years ago

The annotation "@ApiDoc" in method Sonata\MediaBundle\Controller\Api\GalleryController::getGalleriesAction() was never imported.

OskarStark commented 9 years ago

can you please provide a PR?

DevMaster112 commented 9 years ago

Can confirm this issue. Got the same problem. Therefore i can't do a 'cap deploy' with capistrano with capifony.

This is the exception that popups in capistrano with capifony:

Generating autoload files post-autoload-dump: ComponentInstaller\Installer::postAutoloadDump Compiling component files post-update-cmd: Incenteev\ParameterHandler\ScriptHandler::buildParameters Updating the "app/config/parameters.yml" file post-update-cmd: Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap post-update-cmd: Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache [Doctrine\Common\Annotations\AnnotationException] [Semantical Error] The annotation "@ApiDoc" in method Sonata\MediaBundle\Controller\Api\GalleryController::getGalleriesAction() was never imported. Did you maybe forget to add a "use" statement for this annotation? Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception [RuntimeException] An error occurred when executing the "'cache:clear --no-warmup'" command.

DevMaster112 commented 9 years ago
Quick solution / workaround to keep your symfony project working

In your composer.json edit following code line:

From:

"require": {
     "sonata-project/media-bundle": "dev-master"
 }

To:

"require": {
     "sonata-project/media-bundle": "dev-master#1cc799eda0fa7dc0fb01045cb36747e89b4bffcf"
 }

This commited dev master (See https://github.com/sonata-project/SonataMediaBundle/commits/master) by @Soullivaneuh is working at least.

Waiting till this bug is fixed.

DevMaster112 commented 9 years ago

After this commit (#9327923) the error is still occuring.

OskarStark commented 9 years ago

can you provide a link what do you mean? my PR isn't merged yet

DevMaster112 commented 9 years ago

Ah my fault. i only saw that you added the referenced. But it isn't merged yet as you said. Waiting for merging.

OskarStark commented 9 years ago

i merged this, try again

DevMaster112 commented 9 years ago

The error is passed. But now another error occurs:

[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The class "FOS\RestBundle\View\View" is not annotated with @Annotation. 
Are you sure this class can be used as annotation? 
If so, then you need to add @Annotation to the _class_ doc comment of "FOS\RestBundle\View\View".
If it is indeed no annotation, then you need to add @IgnoreAnnotation("View") to the _class_
doc comment of method Sonata\MediaBundle\Controller\Api\MediaController::getMediaAction().

Dont know if its a problem of FOSUserBundle or SonataMediaBundle.

OskarStark commented 9 years ago

please try to fix this and then provide a PR or the Solution here to me

DevMaster112 commented 9 years ago

The solution for MediaBundle will be this (said in error text): then you need to add @IgnoreAnnotation("View") to the class doc comment of method Sonata\MediaBundle\Controller\Api\MediaController::getMediaAction()

If this doesn't help, i will start an issue at FOSUserBundle.

cacahouwete commented 9 years ago

to fix it, I add / replace some "use" in "Sonata\MediaBundle\Controller\Api\MediaController.php":

use FOS\RestBundle\Controller\Annotations\QueryParam; use FOS\RestBundle\Controller\Annotations\Route; use FOS\RestBundle\Controller\Annotations\View; // use FOS\RestBundle\View\View;

OskarStark commented 9 years ago

ping @core23 can you please check this out?

OskarStark commented 9 years ago

Fixxed by #879