Doctrine ORM Error - symfony

ContextErrorException:
Catchable Fatal Error: Argument 1 passed to Sonata\EasyExtendsBundle\Mapper\DoctrineORMMapper::loadClassMetadata() must be an instance of Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs, instance of Doctrine\ORM\Event\LoadClassMetadataEventArgs given
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": "2.3.*",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"sonata-project/admin-bundle": "2.3.*",
"friendsofsymfony/user-bundle": "1.3.2",
"sonata-project/user-bundle": "dev-master",
"sonata-project/datagrid-bundle": "~2.2#dev",
"sonata-project/doctrine-orm-admin-bundle": "2.3.*"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "stable",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}

Edit:
This is now fixed in the 2.1.9 version (source).
There was a commit in the EasyExtends bundle (source) that seems to have caused this.
My suggestion is to add an explicit version in your composer.json file for the time being. The version I got this error in is 2.1.8, so I used the version before that commit:
"sonata-project/easy-extends-bundle": "2.1.7"

Check your use statements in the class where you're getting the exception, try replacing use Doctrine\ORM\Event\LoadClassMetadataEventArgs; with use Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs;, or try digging around with a debugger.

Related

install sonata ecommerce with composer.phar update

when i try to install sonata ecommerce with composer.phar update
error [runtimeExeption] Could not load package
orange-opensource/orange-boosted-bootstrap in http://packagist.org:
[unexpectedValueException] Could not parse version constraint
v4.0.0-alpha.3.1 Invalid version string "v4.0.0-alpha.3.1" .
composer.json
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": {
"": "src/"
}
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.7.*",
"doctrine/orm": "~2.4,>=2.4.5",
"doctrine/doctrine-bundle": "1.5.*",
"twig/extensions": "1.2.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/security": "#stable",
"symfony/monolog-bundle": "#stable",
"sensio/distribution-bundle": "4.0.*",
"sensio/framework-extra-bundle": "3.0.*",
"sensio/generator-bundle": "2.3.*",
"leafo/lessphp": "*",
"twitter/bootstrap": "*",
"friendsofsymfony/jsrouting-bundle": "#stable",
"friendsofsymfony/user-bundle": "#stable",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/comment-bundle":"#stable",
"sonata-project/core-bundle": "#stable",
"sonata-project/media-bundle": "2.3.3",
"sonata-project/admin-bundle": "#stable",
"sonata-project/doctrine-orm-admin-bundle": "#stable",
"knplabs/knp-paginator-bundle": "#stable",
"sonata-project/translation-bundle": "~1",
"a2lix/translation-form-bundle": "1.*#dev",
"a2lix/i18n-doctrine-bundle": "^0.1.0",
"jordillonch/crud-generator": "dev-master",
"knplabs/doctrine-behaviors": "#stable",
"doctrine/doctrine-fixtures-bundle": "#stable",
"sonata-project/user-bundle": "#stable",
"fp/jsformvalidator-bundle":"#stable",
"ensepar/html2pdf-bundle" : "#stable",
"sonata-project/ecommerce": "#stable",
"ibrows/newsletter-bundle": "*"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "stable",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}
Your composer.json file seems fine - I was able to run it with "composer.phar update" without any issue.
Try updating composer with "composer.phar self-update" and clearing it's cache with "composer.phar clear-cache".

Deprecations in project after upgrade to Symfony 3.3

I have just upgrade my Symfony project to the latest version (3.3). Now my project does give some deprecations warnings but does not point anything to my code.
In total of 8 warning I need to fix before I can upgrade to a newer version later.
I checked my composer.json file for out dated releases but couldn't find any.
Composer.json file that is in my project looks like:
{
"name": "domji/collection-manager",
"license": "proprietary",
"type": "project",
"autoload": {
"files": ["app/AppKernel.php"],
"psr-4": {
"": "src/",
"SymfonyStandard\\": "app/SymfonyStandard/"
}
},
"require": {
"php": ">=5.3.9",
"symfony/symfony": "3.*",
"symfony/console": "3.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "^2.8",
"symfony/polyfill-apcu": "^1.0",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "~3.0",
"incenteev/composer-parameter-handler": "^2.0",
"friendsofsymfony/user-bundle": "~2.0",
"ornicar/gravatar-bundle" : "~1.0",
"symfony/assetic-bundle": "^2.7",
"imdbphp/imdbphp": "^5.2"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"scripts": {
"post-root-package-install": [
"SymfonyStandard\\Composer::hookRootPackageInstall"
],
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-var-dir": "var",
"symfony-bin-dir": "bin",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
}
}
}
Can someone help me where the decrecated calls come from?
Updating to the newest version of Assetic bundle fixed all my deprecation errors.

Getting error while installing SyliusCartBundle with composer

I'm tring to install SyliusCartBundle in my Symfony2 application using composer, please help me save my day.
in the composer.json associated to the Bundle it require:
"php": ">=5.3.3",
"symfony/framework-bundle": "~2.3",
"sylius/order-bundle": "0.12.*#dev",
"sylius/money-bundle": "0.12.*#dev",
"sylius/resource-bundle": "0.12.*#dev",
"sylius/cart": "0.12.*#dev"
this the commande line i'm using to install the bundle
composer require "sylius/cart-bundle:0.12.0"
but i get this error:
This is my composer.json :
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "stable",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}
You need to rewrite your composer json file to meet the requirements of SyliusCartBundle (doctrine-bundle with version ~1.3):
"require": {
...
"doctrine/doctrine-bundle": "~1.3",
...
},

Upgrading Symfony 2.2 to 2.3 causes silent 500 errors

I just upgraded my Symfony 2.2 installation to Symfony 2.3. I was abe to get "composer update" to run with no errors, but this has caused every route in my application to return a blank page. If I check the network tab on my JavaScript console, I see that a 500 Internal Server Error is being thrown, but have no insight as to what might be causing it. Any ideas? Here's my composer.json file:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"jms/security-extra-bundle": "1.5.*",
"jms/di-extra-bundle": "1.4.*",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/jsrouting-bundle": "*",
"sandeepshetty/shopify_api": "dev-master#dev"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}
You need to enable it manually in 2.3.
Debug::enable();
See: https://github.com/symfony/symfony-standard/blob/2.3/UPGRADE-2.3.md
Inspect your logifles in order to find the exception... app/logs/dev.log or app/logs/prod.log depending on which environment you are trying to access.
And clear your cache :-)
app/console cache:clear
Update those lines from your composer.json thouse versions are not supported by symfony >= 2.3
Before
"jms/security-extra-bundle": "1.5.*",
"jms/di-extra-bundle": "1.4.*",
After
"jms/di-extra-bundle": "dev-master",
"jms/security-extra-bundle": "dev-master",
Regards.

Symfony2 and composer issue: "Could not parse version constraint composer.phar..."

So I'm having issues trying to get composer to work again after installing the Sonata Admin Bundle on Symfony2. When using the command php composer.phar ...., I get the following error message: [UnexpectedValueException] Could not parse version constraint composer.phar: Invalid version string "composer.phar"
It doesn't matter what action I do with composer, it always produces that error. Well, one exception is php composer.phar require --no-update sonata-project/media-bundle says it updated composer.json with no error message, but didn't actually install anything.
So far I have just removed and reinstalled composer.phar with an updated version. I'm running Symfony 2.2.1-dev on Mac OS 10.7.5 with MAMP and PHP 5.4.4. Not sure if this is related, but I also cannot clear the cache using php app/console cache:clear anymore either. I have to delete the cache via Finder.
Here's my composer.json file just in case:
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": "composer.phar",
"symfony/symfony": "2.2.*",
"doctrine/orm": "2.3.*",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.2.*",
"symfony/monolog-bundle": "2.2.*",
"sensio/distribution-bundle": "2.2.*",
"sensio/framework-extra-bundle": "2.2.*",
"sensio/generator-bundle": "2.2.*",
"jms/security-extra-bundle": "1.4.*",
"jms/di-extra-bundle": "1.3.*",
"sonata-project/cache-bundle": "dev-master",
"sonata-project/block-bundle": "dev-master",
"sonata-project/jquery-bundle": "1.8.*",
"knplabs/knp-menu-bundle": "1.1.*-dev",
"sonata-project/exporter": "1.1.*",
"sonata-project/admin-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"doctrine/common": "2.3.x-dev",
"sonata-project/media-bundle": "dev-master"
},
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"branch-alias": {
"dev-master": "2.2-dev"
}
}
Any help/advice would be great :)
Looks like you have some typos in your composer file.
Replace "php": "composer.phar" with "php": ">=5.3.3" and add the missing closing bracket at the end of your file :
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.*",
"doctrine/orm": "2.3.*",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.2.*",
"symfony/monolog-bundle": "2.2.*",
"sensio/distribution-bundle": "2.2.*",
"sensio/framework-extra-bundle": "2.2.*",
"sensio/generator-bundle": "2.2.*",
"jms/security-extra-bundle": "1.4.*",
"jms/di-extra-bundle": "1.3.*",
"sonata-project/cache-bundle": "dev-master",
"sonata-project/block-bundle": "dev-master",
"sonata-project/jquery-bundle": "1.8.*",
"knplabs/knp-menu-bundle": "1.1.*-dev",
"sonata-project/exporter": "1.1.*",
"sonata-project/admin-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"doctrine/common": "2.3.x-dev",
"sonata-project/media-bundle": "dev-master"
},
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"branch-alias": {
"dev-master": "2.2-dev"
}
}
}

Resources