Brieuc
Brieuc

Reputation: 4114

Sonata, sf2 : Undefined index: context when deleting an image from MediaBundle

I installed all the Bundles of Sonata following the documentation step by step. I still have few errors to fix on some actions such as deleting images. All the errors i'm facing right now seem related.

I submited two issues, one SonataMediaBundle and one in SonataClassificationBundle.

in vendor/sonata-project/media-bundle/Admin/BaseMediaAdmin.php at line 118

if ($filter = $this->getRequest()->get('filter')) {
    $context = $filter['context']['value'];
} else {
    $context = $this->getRequest()->get('context', $this->pool->getDefaultContext());
}

1 - DEBUG - Router Sonata\PageBundle\Route\CmsPageRouter was not able to match, message "No site defined"

"No site defined" makes me guess i should do something on that. I did create a default page with the SonataPageBundle (added in database). I don't know if there is a specific parameter to add in the config. As i said i followed the documentation step by step and i don't see anything related to defining a site. However i'm not sure "no site defined" is related to the main error.

Here my composer.json in case it could be usefull.

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.6.",
    "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.4",
    "sensio/distribution-bundle": "~3.0.12",
    "sensio/framework-extra-bundle": "~3.0",
    "incenteev/composer-parameter-handler": "~2.0",
    "sonata-project/core-bundle": "~2.2@dev",
    "sonata-project/notification-bundle": "~2.3",
    "knplabs/knp-markdown-bundle": "~1.2",
    "videlalvaro/php-amqplib": "~2.4",
    "liip/monitor-bundle": "~2.0",
    "symfony-cmf/routing-bundle": "1.4.@dev",
    "jms/serializer-bundle": "0.13.*@dev",
    "sonata-project/formatter-bundle": "~2.3",
    "sonata-project/markitup-bundle": "~2.1",
    "sonata-project/intl-bundle": "~2.2",
    "sonata-project/cache-bundle": "~2.2",
    "sonata-project/seo-bundle": "~1.1",
    "sonata-project/easy-extends-bundle": "~2.1",
    "sonata-project/admin-bundle": "~2.3",
    "sonata-project/doctrine-orm-admin-bundle": "~2.3",
    "sonata-project/user-bundle": "~2.2",
    "sonata-project/classification-bundle": "dev-master",
    "sonata-project/news-bundle": "dev-master",
    "sonata-project/timeline-bundle": "~2.2@dev",
    "sonata-project/media-bundle": "~2.4@dev",
    "sonata-project/page-bundle": "~2.3@dev"
}

Any solutions or hints?

Upvotes: 0

Views: 580

Answers (1)

rande
rande

Reputation: 666

PageBundle is ignoring admin routes, so you get a notice with "No site defined" (Nothing to look more about this). I cannot reproduce the issue you state with the current dev-master code.

Please use stable version of bundles or libs.

Upvotes: 1

Related Questions