Search code examples
phpsymfonysonata-adminsymfony-sonatasonata

Broken Sonata Admin asset paths after composer update in Symfony 2 project


After months of not working on a Symfony project I have came back to it and done a composer update to update all my dependencies.

One dependencies that was out of date was Sonata Admin and what I have found since that update is that all the paths when I view the /admin/dashboard/ are broken - so my admin is borked.

This is what Firefox error console is saying:

    NetworkError: 500 Internal Server Error - 
http://www.ayrshireminis.com/bundles/sonatacore/vendor/bootstrap/dist/css/bootstrap.min.css
    NetworkError: 500 Internal Server Error - 
http://www.ayrshireminis.com/bundles/sonatacore/vendor/components-font-awesome/css/font-awesome.min.css
    NetworkError: 500 Internal Server Error - 
http://www.ayrshireminis.com/bundles/sonatacore/vendor/ionicons/css/ionicons.min.css
    NetworkError: 500 Internal Server Error - 
http://www.ayrshireminis.com/bundles/sonatacore/vendor/select2/select2-bootstrap.css
    NetworkError: 500 Internal Server Error - 
http://www.ayrshireminis.com/bundles/sonatacore/vendor/bootstrap/dist/js/bootstrap.min.js
    NetworkError: 500 Internal Server Error - 
http://www.ayrshireminis.com/bundles/sonatacore/vendor/select2/select2.min.js
    NetworkError: 500 Internal Server Error - 
http://www.ayrshireminis.com/bundles/sonatacore/vendor/jquery/dist/jquery.min.js
    NetworkError: 500 Internal Server Error - 
http://www.ayrshireminis.com/bundles/sonatacore/vendor/select2/select2.css

This is in my composer.json:

    "sonata-project/admin-bundle": "dev-master",
    "sonata-project/doctrine-orm-admin-bundle": "2.2.7",

Is there any config I need to make to get this working again? I don't have those scripts in the paths that it is looking for.

enter image description here


Solution

  • It depends what "sonata-project/admin-bundle": "dev-master", requires. See https://packagist.org/packages/sonata-project/admin-bundle. Latest version is 2.4.x

    Try with version 2.3: "sonata-project/admin-bundle": "2.3.*@dev".

    If you still want to use 2.4 (dev-master) version, then check requirements for that version and replace require packages (and versions) in composer.json.