{"action":"created","issue":{"url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/489","repository_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle","labels_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/489/labels{/name}","comments_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/489/comments","events_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/489/events","html_url":"https://github.com/sonata-project/SonataMediaBundle/issues/489","id":27435463,"number":489,"title":"Twig helpers are not retrieving context for galleries","user":{"login":"lologhi","id":81240,"avatar_url":"https://avatars.githubusercontent.com/u/81240?v=3","gravatar_id":"","url":"https://api.github.com/users/lologhi","html_url":"https://github.com/lologhi","followers_url":"https://api.github.com/users/lologhi/followers","following_url":"https://api.github.com/users/lologhi/following{/other_user}","gists_url":"https://api.github.com/users/lologhi/gists{/gist_id}","starred_url":"https://api.github.com/users/lologhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lologhi/subscriptions","organizations_url":"https://api.github.com/users/lologhi/orgs","repos_url":"https://api.github.com/users/lologhi/repos","events_url":"https://api.github.com/users/lologhi/events{/privacy}","received_events_url":"https://api.github.com/users/lologhi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-02-12T14:07:23Z","updated_at":"2016-02-13T11:48:14Z","closed_at":"2016-02-13T11:48:14Z","body":"Hi !\r\nWhen trying to use the media helper on a gallery :\r\n```Twig\r\n{% media news.images, 'News_home' %}\r\n```\r\nI get this nice error : The image format \"default_News_home\" is not defined.\r\nThis was well configured :\r\n```YAML\r\nNews:\r\n    providers:\r\n        - sonata.media.provider.image\r\n    formats:\r\n        home:  { width: 400 , quality: 70}\r\n```\r\n\r\nIn Sonata\\MediaBundle\\Provider\\BaseProvider.php, I can find this :\r\n```\r\n$baseName = $media->getContext().'_';\r\nif (substr($format, 0, strlen($baseName)) == $baseName) {\r\n    return $format;\r\n}\r\nreturn $baseName.$format;\r\n```\r\nCalled by Sonata\\MediaBundle\\Twig\\Extension\\MediaExtension.php\r\n```\r\n$format = $provider->getFormatName($media, $format);\r\n```\r\n\r\nSo I'm wondering if the getContext() of a Gallery is working... In my database, I can see that the medias linked to my gallery have the News context.\r\n\r\nThanks !"},"comment":{"url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/comments/183650067","html_url":"https://github.com/sonata-project/SonataMediaBundle/issues/489#issuecomment-183650067","issue_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/489","id":183650067,"user":{"login":"core23","id":3440437,"avatar_url":"https://avatars.githubusercontent.com/u/3440437?v=3","gravatar_id":"","url":"https://api.github.com/users/core23","html_url":"https://github.com/core23","followers_url":"https://api.github.com/users/core23/followers","following_url":"https://api.github.com/users/core23/following{/other_user}","gists_url":"https://api.github.com/users/core23/gists{/gist_id}","starred_url":"https://api.github.com/users/core23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/core23/subscriptions","organizations_url":"https://api.github.com/users/core23/orgs","repos_url":"https://api.github.com/users/core23/repos","events_url":"https://api.github.com/users/core23/events{/privacy}","received_events_url":"https://api.github.com/users/core23/received_events","type":"User","site_admin":false},"created_at":"2016-02-13T11:48:14Z","updated_at":"2016-02-13T11:48:14Z","body":"Please check this issue again and reopen if this is still active @lologhi "}}