Fixing Error after Deleting Bundles and Entities on Symfony2


I just deleted several Bundles on my project, the Bundles are AcmeDemoBundle and my own bundle BlogUserBundle, and of course it will cause several errors in the project the error message is “Unknown Entity namespace alias bla2…“, so I have to change and adjust several modifications in the several files to make it work again, let start with the easier way :

  1. Go to the app/cache delete all folders and file inside this folder.
  2. Go to app/AppKerner.php then look for bundles name that you have been deleted to unregister them.
  3. Go to app/config/routing_dev.yml delete all configuration that contain bundles name that you have been deleted to unregister them.
  4. Go to app/config/routing.yml delete all configuration that contain bundles name that you have been deleted to unregister them.
  5. Go to app/config/security.yml delete all configuration that contain bundles name that you have been deleted to unregister them.
  6. Go to  app/logs delete all folders and file inside this folder.

Let check, still error ?

go to console and find the bundle name using :

grep -R -i “YourBundle” /yourProjectFolder

find the paths/files that still contain deleted bundle name, open the files and delete the lines that still contain the deleted Bundle Names.

then try to :

./console cache:clear

./console cache:warmup

 

 

One thought on “Fixing Error after Deleting Bundles and Entities on Symfony2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s