{"action":"created","issue":{"url":"https://api.github.com/repos/elmsln/elmsln/issues/377","labels_url":"https://api.github.com/repos/elmsln/elmsln/issues/377/labels{/name}","comments_url":"https://api.github.com/repos/elmsln/elmsln/issues/377/comments","events_url":"https://api.github.com/repos/elmsln/elmsln/issues/377/events","html_url":"https://github.com/elmsln/elmsln/issues/377","id":120932583,"number":377,"title":"Rip exposed filters View block into the local_subheading region","user":{"login":"btopro","id":329735,"avatar_url":"https://avatars.githubusercontent.com/u/329735?v=3","gravatar_id":"","url":"https://api.github.com/users/btopro","html_url":"https://github.com/btopro","followers_url":"https://api.github.com/users/btopro/followers","following_url":"https://api.github.com/users/btopro/following{/other_user}","gists_url":"https://api.github.com/users/btopro/gists{/gist_id}","starred_url":"https://api.github.com/users/btopro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btopro/subscriptions","organizations_url":"https://api.github.com/users/btopro/orgs","repos_url":"https://api.github.com/users/btopro/repos","events_url":"https://api.github.com/users/btopro/events{/privacy}","received_events_url":"https://api.github.com/users/btopro/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elmsln/elmsln/labels/infrastructure","name":"infrastructure","color":"fad8c7"},{"url":"https://api.github.com/repos/elmsln/elmsln/labels/style%20guide%20/%20theme","name":"style guide / theme","color":"d4c5f9"},{"url":"https://api.github.com/repos/elmsln/elmsln/labels/User%20Experience","name":"User Experience","color":"eb6420"}],"state":"closed","locked":false,"assignee":{"login":"btopro","id":329735,"avatar_url":"https://avatars.githubusercontent.com/u/329735?v=3","gravatar_id":"","url":"https://api.github.com/users/btopro","html_url":"https://github.com/btopro","followers_url":"https://api.github.com/users/btopro/followers","following_url":"https://api.github.com/users/btopro/following{/other_user}","gists_url":"https://api.github.com/users/btopro/gists{/gist_id}","starred_url":"https://api.github.com/users/btopro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btopro/subscriptions","organizations_url":"https://api.github.com/users/btopro/orgs","repos_url":"https://api.github.com/users/btopro/repos","events_url":"https://api.github.com/users/btopro/events{/privacy}","received_events_url":"https://api.github.com/users/btopro/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/elmsln/elmsln/milestones/2","html_url":"https://github.com/elmsln/elmsln/milestones/Release%200.1.x","labels_url":"https://api.github.com/repos/elmsln/elmsln/milestones/2/labels","id":1082493,"number":2,"title":"Release 0.1.x","description":"We are in the transition from master to full on releases. This is primarily a UX unification release as well as stability. State of tools for this release:\r\nCourses: Stable\r\nCIS/Online:Stable (UX needed though)\r\nMedia: Beta\r\nStudio: Alpha\r\nDiscuss: Alpha\r\nBlogs: Alpha\r\nCompliance: Dev\r\nInbox: Placeholder","creator":{"login":"btopro","id":329735,"avatar_url":"https://avatars.githubusercontent.com/u/329735?v=3","gravatar_id":"","url":"https://api.github.com/users/btopro","html_url":"https://github.com/btopro","followers_url":"https://api.github.com/users/btopro/followers","following_url":"https://api.github.com/users/btopro/following{/other_user}","gists_url":"https://api.github.com/users/btopro/gists{/gist_id}","starred_url":"https://api.github.com/users/btopro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btopro/subscriptions","organizations_url":"https://api.github.com/users/btopro/orgs","repos_url":"https://api.github.com/users/btopro/repos","events_url":"https://api.github.com/users/btopro/events{/privacy}","received_events_url":"https://api.github.com/users/btopro/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":35,"state":"open","created_at":"2015-04-24T16:03:10Z","updated_at":"2015-12-09T13:29:11Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-12-08T05:11:46Z","updated_at":"2015-12-09T13:29:11Z","closed_at":"2015-12-09T13:29:11Z","body":"`local_subheading` is the 3rd level of navigational structure in foundation access. This allows for manipulation of interfaces currently visible (most common case being views). We can skip needing to place view blocks all over the place if we take views that have this exposed setting and when they do, forcibly render their filters as a block (probably can force it to work even if this is disabled but we'll see).\r\n\r\nCode to refactor from `views.module`:\r\n```\r\n/**\r\n * Implement hook_block_view().\r\n */\r\nfunction views_block_view($delta) {\r\n  $start = microtime(TRUE);\r\n  // if this is 32, this should be an md5 hash.\r\n  if (strlen($delta) == 32) {\r\n    $hashes = variable_get('views_block_hashes', array());\r\n    if (!empty($hashes[$delta])) {\r\n      $delta = $hashes[$delta];\r\n    }\r\n  }\r\n\r\n  // This indicates it's a special one.\r\n  if (substr($delta, 0, 1) == '-') {\r\n    list($nothing, $type, $name, $display_id) = explode('-', $delta);\r\n    // Put the - back on.\r\n    $type = '-' . $type;\r\n    if ($view = views_get_view($name)) {\r\n      if ($view->access($display_id)) {\r\n        $view->set_display($display_id);\r\n        if (isset($view->display_handler)) {\r\n          $output = $view->display_handler->view_special_blocks($type);\r\n          // Before returning the block output, convert it to a renderable\r\n          // array with contextual links.\r\n          views_add_block_contextual_links($output, $view, $display_id, 'special_block_' . $type);\r\n          $view->destroy();\r\n          return $output;\r\n        }\r\n      }\r\n      $view->destroy();\r\n    }\r\n  }\r\n\r\n  // If the delta doesn't contain valid data return nothing.\r\n  $explode = explode('-', $delta);\r\n  if (count($explode) != 2) {\r\n    return;\r\n  }\r\n  list($name, $display_id) = $explode;\r\n  // Load the view\r\n  if ($view = views_get_view($name)) {\r\n    if ($view->access($display_id)) {\r\n      $output = $view->execute_display($display_id);\r\n      // Before returning the block output, convert it to a renderable array\r\n      // with contextual links.\r\n      views_add_block_contextual_links($output, $view, $display_id);\r\n      $view->destroy();\r\n      return $output;\r\n    }\r\n    $view->destroy();\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/elmsln/elmsln/issues/comments/163231844","html_url":"https://github.com/elmsln/elmsln/issues/377#issuecomment-163231844","issue_url":"https://api.github.com/repos/elmsln/elmsln/issues/377","id":163231844,"user":{"login":"btopro","id":329735,"avatar_url":"https://avatars.githubusercontent.com/u/329735?v=3","gravatar_id":"","url":"https://api.github.com/users/btopro","html_url":"https://github.com/btopro","followers_url":"https://api.github.com/users/btopro/followers","following_url":"https://api.github.com/users/btopro/following{/other_user}","gists_url":"https://api.github.com/users/btopro/gists{/gist_id}","starred_url":"https://api.github.com/users/btopro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btopro/subscriptions","organizations_url":"https://api.github.com/users/btopro/orgs","repos_url":"https://api.github.com/users/btopro/repos","events_url":"https://api.github.com/users/btopro/events{/privacy}","received_events_url":"https://api.github.com/users/btopro/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T13:29:11Z","updated_at":"2015-12-09T13:29:11Z","body":"of special note so we don't forget: In views, if you expose filters for use in a block but that block is never placed you've effectively eliminated the filters. This isn't an issue for foundation_access sub-themes because of the fix applied for this issue which sniffs out exposed view blocks and automatically adds them to the interface (see above commit). Just wanted to note this as I close it out in case it comes up"}}