{"action":"created","issue":{"url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1135","labels_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1135/labels{/name}","comments_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1135/comments","events_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1135/events","html_url":"https://github.com/backdrop/backdrop-issues/issues/1135","id":103967876,"number":1135,"title":"copying field.tpl.php into a custom theme crashes your site","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/pr%20-%20needs%20work","name":"pr - needs work","color":"FFECE8"},{"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":{"url":"https://api.github.com/repos/backdrop/backdrop-issues/milestones/3","html_url":"https://github.com/backdrop/backdrop-issues/milestones/1.x-future","labels_url":"https://api.github.com/repos/backdrop/backdrop-issues/milestones/3/labels","id":427669,"number":3,"title":"1.x-future","description":"Milestone for any feature that should be added or bug that should be fixed in the 1.x series at an undetermined time in the future. Please use this for any features that have not had a milestone explicitly stated.","creator":{"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},"open_issues":121,"closed_issues":20,"state":"open","created_at":"2013-09-14T18:40:59Z","updated_at":"2016-01-01T02:21:57Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-08-31T00:59:40Z","updated_at":"2016-01-02T02:08:09Z","closed_at":null,"body":"I just got a nasty fatal error when I copied field.tpl.php from core/modules/field/templates/field.tpl.php into my theme:\r\n```\r\nRecoverable fatal error: Argument 1 passed to backdrop_attributes() must be of the type array, null given, called in /backdrop/themes/boots/templates/field.tpl.php on line 57 and defined in backdrop_attributes() (line 2613 of /Users/jlampton/Sites/boots/backdrop/html/core/includes/common.inc).\r\n```\r\nIt looks like the problem is that `$item_attributes` doesn't exist. It's never set in `template_preprocess_field`, or anywhere else that I can see.  Is it supposed to be? If not, why was it ever in here?"},"comment":{"url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/comments/168357273","html_url":"https://github.com/backdrop/backdrop-issues/issues/1135#issuecomment-168357273","issue_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1135","id":168357273,"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":"2016-01-02T02:08:09Z","updated_at":"2016-01-02T02:08:09Z","body":"It looks like the need to check for all these variables is a remanent of removing template_process_fields(), which defined all of these:\r\n\r\nhttps://api.drupal.org/api/drupal/modules!field!field.module/function/template_process_field/7\r\n\r\nWe should just ensure each of these variables is populated with at least an empty array in our existing template_preprocess_field()."}}