{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/13417","labels_url":"https://api.github.com/repos/symfony/symfony/issues/13417/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/13417/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/13417/events","html_url":"https://github.com/symfony/symfony/issues/13417","id":54425557,"number":13417,"title":"Bootstrap form theme - variable \"widget\" does not exist","user":{"login":"nicolaskern","id":1478783,"avatar_url":"https://avatars.githubusercontent.com/u/1478783?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolaskern","html_url":"https://github.com/nicolaskern","followers_url":"https://api.github.com/users/nicolaskern/followers","following_url":"https://api.github.com/users/nicolaskern/following{/other_user}","gists_url":"https://api.github.com/users/nicolaskern/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolaskern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolaskern/subscriptions","organizations_url":"https://api.github.com/users/nicolaskern/orgs","repos_url":"https://api.github.com/users/nicolaskern/repos","events_url":"https://api.github.com/users/nicolaskern/events{/privacy}","received_events_url":"https://api.github.com/users/nicolaskern/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-15T08:56:10Z","updated_at":"2015-01-17T20:49:44Z","closed_at":null,"body":"Hi,\r\n\r\nWe encountered a problem documented in this comment : https://gist.github.com/cowlby/1294186#comment-1362520\r\n\r\n```Variable \"widget\" does not exist in bootstrap_3_layout.html.twig at line 169```\r\n\r\nAs I said in my answer to this comment, a quick temporary fix was to replace the line 169 with :\r\n```{{ widget|default('')|raw }}```\r\n\r\nThis problem can be reproduced with the following configuration and the use of the bundle https://github.com/J-Mose/CommandSchedulerBundle\r\n```\r\ntwig:\r\n    form:\r\n        resources: ['bootstrap_3_layout.html.twig' ]\r\n```\r\n\r\nIs this a known problem ?\r\n\r\nThanks,\r\nNicolas"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/70383800","html_url":"https://github.com/symfony/symfony/issues/13417#issuecomment-70383800","issue_url":"https://api.github.com/repos/symfony/symfony/issues/13417","id":70383800,"user":{"login":"lyrixx","id":408368,"avatar_url":"https://avatars.githubusercontent.com/u/408368?v=3","gravatar_id":"","url":"https://api.github.com/users/lyrixx","html_url":"https://github.com/lyrixx","followers_url":"https://api.github.com/users/lyrixx/followers","following_url":"https://api.github.com/users/lyrixx/following{/other_user}","gists_url":"https://api.github.com/users/lyrixx/gists{/gist_id}","starred_url":"https://api.github.com/users/lyrixx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyrixx/subscriptions","organizations_url":"https://api.github.com/users/lyrixx/orgs","repos_url":"https://api.github.com/users/lyrixx/repos","events_url":"https://api.github.com/users/lyrixx/events{/privacy}","received_events_url":"https://api.github.com/users/lyrixx/received_events","type":"User","site_admin":false},"created_at":"2015-01-17T20:49:44Z","updated_at":"2015-01-17T20:49:44Z","body":"Hi.\r\n\r\nThe `bootstrap_3_layout.html.twig` works as expected.\r\n\r\nBut the [CommandSchedulerBundle template](https://github.com/J-Mose/CommandSchedulerBundle/blob/c77138060718603ba74451430cc2b3e80cba925b/Resources/views/Detail/index.html.twig#L21-L24) re-implements on its own the bootstrap layout. So when a user tries to combine the symfony bootstrap template (like this issue) and CommandSchedulerBundle it does not work because symfony has already rendered the widget **and** the label. To fully understand what happens, one should read [that](https://github.com/symfony/symfony/blob/2.7/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig#L118) then [that](https://github.com/symfony/symfony/blob/2.7/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig#L169). So as you can read, and because bootstrap needs a really custom / weird DOM, I had to \"hack\" the form templating layer. \r\n\r\nThere is at least 2 options to fix that:\r\n\r\n* Update the CommandSchedulerBundle to use the native/symfony bootstrap, but it would require symfony 2.6+ ..., or doing some check to use one template or another one\r\n* **or** add a safeguard in symfony (the same as describe in this issue). but  i will create another issue: the label will be render twice. (one by symfony by calling ` {{ form_widget( scheduledCommandForm.executeImmediately ) }}` and another one by calling `{{ form_label( scheduledCommandForm.executeImmediately ) }`)\r\n\r\nActually, I don't like theses options.\r\n\r\n**BUT**: There is a last option ;), updating the CommandSchedulerBundle to ensure the label is not already => [PR](https://github.com/J-Mose/CommandSchedulerBundle/pull/2)"}}