{"action":"created","issue":{"url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/570","labels_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/570/labels{/name}","comments_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/570/comments","events_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/570/events","html_url":"https://github.com/backdrop/backdrop-issues/issues/570","id":53975495,"number":570,"title":"How to prevent \"broken blocks\"?","user":{"login":"docwilmot","id":1042283,"avatar_url":"https://avatars.githubusercontent.com/u/1042283?v=3","gravatar_id":"","url":"https://api.github.com/users/docwilmot","html_url":"https://github.com/docwilmot","followers_url":"https://api.github.com/users/docwilmot/followers","following_url":"https://api.github.com/users/docwilmot/following{/other_user}","gists_url":"https://api.github.com/users/docwilmot/gists{/gist_id}","starred_url":"https://api.github.com/users/docwilmot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docwilmot/subscriptions","organizations_url":"https://api.github.com/users/docwilmot/orgs","repos_url":"https://api.github.com/users/docwilmot/repos","events_url":"https://api.github.com/users/docwilmot/events{/privacy}","received_events_url":"https://api.github.com/users/docwilmot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/backdrop/backdrop-issues/labels/type+-+bug+report","name":"type - bug report","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-10T23:30:44Z","updated_at":"2015-01-12T03:22:17Z","closed_at":null,"body":"If a module providing a block which has been added to Layout is uninstalled or disbled, the block remains but says: 'This block requires the %module module. Either re-enable the module, or remove this block.' Not nice.\r\nHow do I remove my_module's bock from Layouts (during hook_uninstall) so this doesnt show?"},"comment":{"url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/comments/69526555","html_url":"https://github.com/backdrop/backdrop-issues/issues/570#issuecomment-69526555","issue_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/570","id":69526555,"user":{"login":"quicksketch","id":100206,"avatar_url":"https://avatars.githubusercontent.com/u/100206?v=3","gravatar_id":"","url":"https://api.github.com/users/quicksketch","html_url":"https://github.com/quicksketch","followers_url":"https://api.github.com/users/quicksketch/followers","following_url":"https://api.github.com/users/quicksketch/following{/other_user}","gists_url":"https://api.github.com/users/quicksketch/gists{/gist_id}","starred_url":"https://api.github.com/users/quicksketch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quicksketch/subscriptions","organizations_url":"https://api.github.com/users/quicksketch/orgs","repos_url":"https://api.github.com/users/quicksketch/repos","events_url":"https://api.github.com/users/quicksketch/events{/privacy}","received_events_url":"https://api.github.com/users/quicksketch/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T03:22:17Z","updated_at":"2015-01-12T03:22:17Z","body":"Hi @docwilmot and @BWPanda, thanks for opening this. The behavior of Layouts is modeled after Views, which has the same behavior if you disable/uninstall a module that provides a View display mode, field/filter/context or any other kind of plugin. In Views, the entire configuration of the view stays intact, with only the unavailable portions showing up a a \"Broken handler\".\r\n\r\nIt is possible for your module to use hook_uninstall() to try and clean up blocks that have been used, but overall I'd say that it shouldn't be your module's responsibility to try and clean up blocks that are used in Layouts. The behavior that they show up as \"Broken\" is intentional, though if we can think of a better way to handle it, we could look into it."}}