{"action":"opened","issue":{"url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1323","labels_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1323/labels{/name}","comments_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1323/comments","events_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1323/events","html_url":"https://github.com/backdrop/backdrop-issues/issues/1323","id":114494861,"number":1323,"title":"Views exposed form in block throws PHP notice","user":{"login":"jenlampton","id":397895,"avatar_url":"https://avatars.githubusercontent.com/u/397895?v=3","gravatar_id":"","url":"https://api.github.com/users/jenlampton","html_url":"https://github.com/jenlampton","followers_url":"https://api.github.com/users/jenlampton/followers","following_url":"https://api.github.com/users/jenlampton/following{/other_user}","gists_url":"https://api.github.com/users/jenlampton/gists{/gist_id}","starred_url":"https://api.github.com/users/jenlampton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenlampton/subscriptions","organizations_url":"https://api.github.com/users/jenlampton/orgs","repos_url":"https://api.github.com/users/jenlampton/repos","events_url":"https://api.github.com/users/jenlampton/events{/privacy}","received_events_url":"https://api.github.com/users/jenlampton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/backdrop/backdrop-issues/labels/audience%20-%20novice","name":"audience - novice","color":"ffffff"},{"url":"https://api.github.com/repos/backdrop/backdrop-issues/labels/type%20-%20bug%20report","name":"type - bug report","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-01T21:38:26Z","updated_at":"2015-11-01T21:38:26Z","closed_at":null,"body":"When a views exposed form in block is placed into a layout, the following PHP notices are thrown:\r\n```\r\nNotice: Undefined property: view::$current_display in backdrop/core/modules/views/views.module on line 568\r\nNotice: Undefined index: in backdrop/core/modules/views/views.module on line 769\r\nNotice: Trying to get property of non-object in backdrop/core/modules/views/views.module on line 769\r\n```\r\n\r\nTo solve this, we just need to wrap the call to `views_add_contextual_links` in a conditional, as follows:\r\n```php\r\n    // Since views exposed filters do not have a current display, test first.\r\n    if (property_exists($view, 'current_display') && isset($view->current_display)) {\r\n      views_add_contextual_links($variables['content'], 'page', $view, $view->current_display);\r\n    }\r\n```"}}