sonata-project / SonataMediaBundle

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

Pool::validate() must be an instance of Sonata\AdminBundle\Validator\ErrorElement #970

Closed ibasaw closed 7 years ago

ibasaw commented 8 years ago
Catchable Fatal Error: Argument 1 passed to Sonata\MediaBundle\Provider\Pool::validate() must be an instance of Sonata\AdminBundle\Validator\ErrorElement, instance of Sonata\CoreBundle\Validator\ErrorElement given

SF2.8.4dev

    "php": ">=5.3.9",
    "symfony/symfony": "2.8.*@dev",
    "sonata-project/core-bundle": "~2.2@dev",
    "sonata-project/media-bundle": "~2.3@dev",
    "sonata-project/easy-extends-bundle": "~2.1",
    "sonata-project/admin-bundle": "^2.3",
    "sonata-project/intl-bundle": "^2.2",
    "sonata-project/doctrine-orm-admin-bundle": "^2.3",

got this error after a composer update

ibasaw commented 8 years ago

fix by #963 PR

KunwarSiddharthSingh commented 7 years ago

How I can fix this error:

Catchable Fatal Error: Argument 1 passed to Sonata\MediaBundle\Provider\Pool::validate() must be an instance of Sonata\AdminBundle\Validator\ErrorElement, instance of Sonata\CoreBundle\Validator\ErrorElement given  

I am using this:-

"php": ">=5.3.3", "symfony/symfony": "2.6.*", "sonata-project/admin-bundle": "^2.3", "sonata-project/media-bundle": "^2.3.x-dev",

OskarStark commented 7 years ago

You should upgrade to SonataAdminBundle 3.x, 2.3. isn't supported anymore.

Shouldn't be that hard, check our UPGRADE.md

KunwarSiddharthSingh commented 7 years ago

Sonata Admin3.x is compatible with Symfony2.6 ?? Because I am working on going project .

KunwarSiddharthSingh commented 7 years ago

By the way same error is coming with SonataAdminBundle 3.x

OskarStark commented 7 years ago

search for Sonata\CoreBundle\Validator\ErrorElement in your custom code and replace it with the class noticed in the error message

KunwarSiddharthSingh commented 7 years ago

Thanks for reply. I am not using any custom class. Just Use default Sonata Media Bundle.

KunwarSiddharthSingh commented 7 years ago

This is my whole composer.json

    "php": ">=5.3.3",
    "symfony/symfony": "2.6.*",
    "doctrine/orm": "~2.2,>=2.2.3,<2.5",
    "doctrine/dbal": "<2.5",
    "doctrine/doctrine-bundle": "~1.2",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~3.0,>=3.0.12",
    "sensio/framework-extra-bundle": "~3.0,>=3.0.2",
    "incenteev/composer-parameter-handler": "~2.0",
    "sonata-project/admin-bundle": "3.x",
    "sonata-project/doctrine-orm-admin-bundle": "^2.3",
    "gedmo/doctrine-extensions": "^2.4",
    "sonata-project/user-bundle": "^2.2",
    "friendsofsymfony/user-bundle": "^1.3",
    "sonata-project/easy-extends-bundle": "^2.1",
    "knplabs/knp-menu": "~1.1",
    "knplabs/knp-menu-bundle": "~1.1",
    "sonata-project/media-bundle": "^3.6",
    "sonata-project/intl-bundle": "^2.2",
    "jms/serializer-bundle": "~0.13",
    "stof/doctrine-extensions-bundle": "^1.2",
    "ob/highcharts-bundle": "^1.2",
    "egeloen/ckeditor-bundle": "^3.0",
    "friendsofsymfony/rest-bundle": "^1.7",
    "friendsofsymfony/elastica-bundle": "^3.1",
    "knplabs/knp-paginator-bundle": "^2.5",
    "aws/aws-sdk-php": "2.8.22",
    "amazonwebservices/aws-sdk-for-php": "dev-master",
    "KnpLabs/Gaufrette": "dev-master",
    "knplabs/knp-gaufrette-bundle": "dev-master",
    "vich/uploader-bundle": "0.14.*",
KunwarSiddharthSingh commented 7 years ago

When I am running this command sudo php composer.phar then showing old version and in composer.json all admin and media are new bundle version ???

greg0ire commented 7 years ago

Off topic, but you should not need sudo

jlamur commented 7 years ago

@Siddharth22 So your problem is related to composer not sonata. Please use slack or stackoverflow which are appropriate communication channels for such issues.