{"action":"opened","number":115,"pull_request":{"url":"https://api.github.com/repos/xwp/wp-customize-posts/pulls/115","id":68168253,"html_url":"https://github.com/xwp/wp-customize-posts/pull/115","diff_url":"https://github.com/xwp/wp-customize-posts/pull/115.diff","patch_url":"https://github.com/xwp/wp-customize-posts/pull/115.patch","issue_url":"https://api.github.com/repos/xwp/wp-customize-posts/issues/115","number":115,"state":"open","locked":false,"title":"Fix PHP notice generated when adding nav menu items","user":{"login":"westonruter","id":134745,"avatar_url":"https://avatars.githubusercontent.com/u/134745?v=3","gravatar_id":"","url":"https://api.github.com/users/westonruter","html_url":"https://github.com/westonruter","followers_url":"https://api.github.com/users/westonruter/followers","following_url":"https://api.github.com/users/westonruter/following{/other_user}","gists_url":"https://api.github.com/users/westonruter/gists{/gist_id}","starred_url":"https://api.github.com/users/westonruter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westonruter/subscriptions","organizations_url":"https://api.github.com/users/westonruter/orgs","repos_url":"https://api.github.com/users/westonruter/repos","events_url":"https://api.github.com/users/westonruter/events{/privacy}","received_events_url":"https://api.github.com/users/westonruter/received_events","type":"User","site_admin":false},"body":"I noticed a PHP notice raised when adding a nav menu item in the Customizer. The notice was generated in `\\WP_Customize_Posts_Preview::filter_get_post_meta_to_add_dynamic_postmeta_settings()`. The post ID being passed into this filter is the placeholder (negative) post ID representing a not-yet-inserted `nav_menu_item` post. Nevertheless, in spite of the nav menu item having a negative post ID, it actually gets passed in as an absolute value (`6691070724235418000 ` instead of `-6691070724235418000`). In either case, the ID gets passed into `get_post()` which would fail since it is not a valid post ID. \r\n\r\nThe meta lookup that is resulting in this issue is for the `type_label` item.\r\n\r\nCall stack:\r\n\r\n```\r\n#0  WP_Customize_Posts_Preview->filter_get_post_meta_to_add_dynamic_postmeta_settings()\r\n#1  call_user_func_array() called at [/srv/www/wordpress-develop/src/wp-includes/plugin.php:235]\r\n#2  apply_filters() called at [/srv/www/wordpress-develop/src/wp-includes/meta.php:539]\r\n#3  metadata_exists() called at [/srv/www/wordpress-develop/src/wp-includes/class-wp-post.php:263]\r\n#4  WP_Post->__isset() called at [/srv/www/wordpress-develop/src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php:547]\r\n#5  WP_Customize_Nav_Menu_Item_Setting->value_as_wp_post_nav_menu_item() called at [/srv/www/wordpress-develop/src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php:473]\r\n#6  WP_Customize_Nav_Menu_Item_Setting->filter_wp_get_nav_menu_items()\r\n#7  call_user_func_array() called at [/srv/www/wordpress-develop/src/wp-includes/plugin.php:235]\r\n#8  apply_filters() called at [/srv/www/wordpress-develop/src/wp-includes/nav-menu.php:700]\r\n#9  wp_get_nav_menu_items() called at [/srv/www/wordpress-develop/src/wp-includes/nav-menu-template.php:321]\r\n#10 wp_nav_menu() called at [/srv/www/wordpress-develop/src/wp-content/themes/twentysixteen/header.php:56]\r\n#11 require_once(/srv/www/wordpress-develop/src/wp-content/themes/twentysixteen/header.php) called at [/srv/www/wordpress-develop/src/wp-includes/template.php:572]\r\n#12 load_template() called at [/srv/www/wordpress-develop/src/wp-includes/template.php:531]\r\n#13 locate_template() called at [/srv/www/wordpress-develop/src/wp-includes/general-template.php:45]\r\n#14 get_header() called at [/srv/www/wordpress-develop/src/wp-content/themes/twentysixteen/index.php:17]\r\n#15 include(/srv/www/wordpress-develop/src/wp-content/themes/twentysixteen/index.php) called at [/srv/www/wordpress-develop/src/wp-includes/template-loader.php:75]\r\n#16 require_once(/srv/www/wordpress-develop/src/wp-includes/template-loader.php) called at [/srv/www/wordpress-develop/src/wp-blog-header.php:19]\r\n#17 require(/srv/www/wordpress-develop/src/wp-blog-header.php) called at [/srv/www/wordpress-develop/src/index.php:17]\r\n```\r\n\r\nThe immediate fix for the symptom is to just make sure that the `get_post()` call actually returns non-empty.","created_at":"2016-04-28T06:04:50Z","updated_at":"2016-04-28T06:04:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"valendesigns","id":62798,"avatar_url":"https://avatars.githubusercontent.com/u/62798?v=3","gravatar_id":"","url":"https://api.github.com/users/valendesigns","html_url":"https://github.com/valendesigns","followers_url":"https://api.github.com/users/valendesigns/followers","following_url":"https://api.github.com/users/valendesigns/following{/other_user}","gists_url":"https://api.github.com/users/valendesigns/gists{/gist_id}","starred_url":"https://api.github.com/users/valendesigns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valendesigns/subscriptions","organizations_url":"https://api.github.com/users/valendesigns/orgs","repos_url":"https://api.github.com/users/valendesigns/repos","events_url":"https://api.github.com/users/valendesigns/events{/privacy}","received_events_url":"https://api.github.com/users/valendesigns/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/xwp/wp-customize-posts/pulls/115/commits","review_comments_url":"https://api.github.com/repos/xwp/wp-customize-posts/pulls/115/comments","review_comment_url":"https://api.github.com/repos/xwp/wp-customize-posts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xwp/wp-customize-posts/issues/115/comments","statuses_url":"https://api.github.com/repos/xwp/wp-customize-posts/statuses/8a501de0f30b9506007fe3754ee2b4d436fb2556","head":{"label":"xwp:bugfix/notice-for-menu-items","ref":"bugfix/notice-for-menu-items","sha":"8a501de0f30b9506007fe3754ee2b4d436fb2556","user":{"login":"xwp","id":9003139,"avatar_url":"https://avatars.githubusercontent.com/u/9003139?v=3","gravatar_id":"","url":"https://api.github.com/users/xwp","html_url":"https://github.com/xwp","followers_url":"https://api.github.com/users/xwp/followers","following_url":"https://api.github.com/users/xwp/following{/other_user}","gists_url":"https://api.github.com/users/xwp/gists{/gist_id}","starred_url":"https://api.github.com/users/xwp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xwp/subscriptions","organizations_url":"https://api.github.com/users/xwp/orgs","repos_url":"https://api.github.com/users/xwp/repos","events_url":"https://api.github.com/users/xwp/events{/privacy}","received_events_url":"https://api.github.com/users/xwp/received_events","type":"Organization","site_admin":false},"repo":{"id":19420787,"name":"wp-customize-posts","full_name":"xwp/wp-customize-posts","owner":{"login":"xwp","id":9003139,"avatar_url":"https://avatars.githubusercontent.com/u/9003139?v=3","gravatar_id":"","url":"https://api.github.com/users/xwp","html_url":"https://github.com/xwp","followers_url":"https://api.github.com/users/xwp/followers","following_url":"https://api.github.com/users/xwp/following{/other_user}","gists_url":"https://api.github.com/users/xwp/gists{/gist_id}","starred_url":"https://api.github.com/users/xwp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xwp/subscriptions","organizations_url":"https://api.github.com/users/xwp/orgs","repos_url":"https://api.github.com/users/xwp/repos","events_url":"https://api.github.com/users/xwp/events{/privacy}","received_events_url":"https://api.github.com/users/xwp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xwp/wp-customize-posts","description":"Edit posts and postmeta in the WordPress Customizer","fork":false,"url":"https://api.github.com/repos/xwp/wp-customize-posts","forks_url":"https://api.github.com/repos/xwp/wp-customize-posts/forks","keys_url":"https://api.github.com/repos/xwp/wp-customize-posts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xwp/wp-customize-posts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xwp/wp-customize-posts/teams","hooks_url":"https://api.github.com/repos/xwp/wp-customize-posts/hooks","issue_events_url":"https://api.github.com/repos/xwp/wp-customize-posts/issues/events{/number}","events_url":"https://api.github.com/repos/xwp/wp-customize-posts/events","assignees_url":"https://api.github.com/repos/xwp/wp-customize-posts/assignees{/user}","branches_url":"https://api.github.com/repos/xwp/wp-customize-posts/branches{/branch}","tags_url":"https://api.github.com/repos/xwp/wp-customize-posts/tags","blobs_url":"https://api.github.com/repos/xwp/wp-customize-posts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xwp/wp-customize-posts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xwp/wp-customize-posts/git/refs{/sha}","trees_url":"https://api.github.com/repos/xwp/wp-customize-posts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xwp/wp-customize-posts/statuses/{sha}","languages_url":"https://api.github.com/repos/xwp/wp-customize-posts/languages","stargazers_url":"https://api.github.com/repos/xwp/wp-customize-posts/stargazers","contributors_url":"https://api.github.com/repos/xwp/wp-customize-posts/contributors","subscribers_url":"https://api.github.com/repos/xwp/wp-customize-posts/subscribers","subscription_url":"https://api.github.com/repos/xwp/wp-customize-posts/subscription","commits_url":"https://api.github.com/repos/xwp/wp-customize-posts/commits{/sha}","git_commits_url":"https://api.github.com/repos/xwp/wp-customize-posts/git/commits{/sha}","comments_url":"https://api.github.com/repos/xwp/wp-customize-posts/comments{/number}","issue_comment_url":"https://api.github.com/repos/xwp/wp-customize-posts/issues/comments{/number}","contents_url":"https://api.github.com/repos/xwp/wp-customize-posts/contents/{+path}","compare_url":"https://api.github.com/repos/xwp/wp-customize-posts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xwp/wp-customize-posts/merges","archive_url":"https://api.github.com/repos/xwp/wp-customize-posts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xwp/wp-customize-posts/downloads","issues_url":"https://api.github.com/repos/xwp/wp-customize-posts/issues{/number}","pulls_url":"https://api.github.com/repos/xwp/wp-customize-posts/pulls{/number}","milestones_url":"https://api.github.com/repos/xwp/wp-customize-posts/milestones{/number}","notifications_url":"https://api.github.com/repos/xwp/wp-customize-posts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xwp/wp-customize-posts/labels{/name}","releases_url":"https://api.github.com/repos/xwp/wp-customize-posts/releases{/id}","deployments_url":"https://api.github.com/repos/xwp/wp-customize-posts/deployments","created_at":"2014-05-04T06:57:25Z","updated_at":"2016-04-27T06:18:54Z","pushed_at":"2016-04-28T06:00:43Z","git_url":"git://github.com/xwp/wp-customize-posts.git","ssh_url":"git@github.com:xwp/wp-customize-posts.git","clone_url":"https://github.com/xwp/wp-customize-posts.git","svn_url":"https://github.com/xwp/wp-customize-posts","homepage":"https://wordpress.org/plugins/customize-posts/","size":1478,"stargazers_count":55,"watchers_count":55,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":42,"forks":11,"open_issues":42,"watchers":55,"default_branch":"develop"}},"base":{"label":"xwp:release/0.5.0","ref":"release/0.5.0","sha":"17c70ca94769e62277525b9dd3b3f4dd652a8f0a","user":{"login":"xwp","id":9003139,"avatar_url":"https://avatars.githubusercontent.com/u/9003139?v=3","gravatar_id":"","url":"https://api.github.com/users/xwp","html_url":"https://github.com/xwp","followers_url":"https://api.github.com/users/xwp/followers","following_url":"https://api.github.com/users/xwp/following{/other_user}","gists_url":"https://api.github.com/users/xwp/gists{/gist_id}","starred_url":"https://api.github.com/users/xwp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xwp/subscriptions","organizations_url":"https://api.github.com/users/xwp/orgs","repos_url":"https://api.github.com/users/xwp/repos","events_url":"https://api.github.com/users/xwp/events{/privacy}","received_events_url":"https://api.github.com/users/xwp/received_events","type":"Organization","site_admin":false},"repo":{"id":19420787,"name":"wp-customize-posts","full_name":"xwp/wp-customize-posts","owner":{"login":"xwp","id":9003139,"avatar_url":"https://avatars.githubusercontent.com/u/9003139?v=3","gravatar_id":"","url":"https://api.github.com/users/xwp","html_url":"https://github.com/xwp","followers_url":"https://api.github.com/users/xwp/followers","following_url":"https://api.github.com/users/xwp/following{/other_user}","gists_url":"https://api.github.com/users/xwp/gists{/gist_id}","starred_url":"https://api.github.com/users/xwp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xwp/subscriptions","organizations_url":"https://api.github.com/users/xwp/orgs","repos_url":"https://api.github.com/users/xwp/repos","events_url":"https://api.github.com/users/xwp/events{/privacy}","received_events_url":"https://api.github.com/users/xwp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xwp/wp-customize-posts","description":"Edit posts and postmeta in the WordPress Customizer","fork":false,"url":"https://api.github.com/repos/xwp/wp-customize-posts","forks_url":"https://api.github.com/repos/xwp/wp-customize-posts/forks","keys_url":"https://api.github.com/repos/xwp/wp-customize-posts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xwp/wp-customize-posts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xwp/wp-customize-posts/teams","hooks_url":"https://api.github.com/repos/xwp/wp-customize-posts/hooks","issue_events_url":"https://api.github.com/repos/xwp/wp-customize-posts/issues/events{/number}","events_url":"https://api.github.com/repos/xwp/wp-customize-posts/events","assignees_url":"https://api.github.com/repos/xwp/wp-customize-posts/assignees{/user}","branches_url":"https://api.github.com/repos/xwp/wp-customize-posts/branches{/branch}","tags_url":"https://api.github.com/repos/xwp/wp-customize-posts/tags","blobs_url":"https://api.github.com/repos/xwp/wp-customize-posts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xwp/wp-customize-posts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xwp/wp-customize-posts/git/refs{/sha}","trees_url":"https://api.github.com/repos/xwp/wp-customize-posts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xwp/wp-customize-posts/statuses/{sha}","languages_url":"https://api.github.com/repos/xwp/wp-customize-posts/languages","stargazers_url":"https://api.github.com/repos/xwp/wp-customize-posts/stargazers","contributors_url":"https://api.github.com/repos/xwp/wp-customize-posts/contributors","subscribers_url":"https://api.github.com/repos/xwp/wp-customize-posts/subscribers","subscription_url":"https://api.github.com/repos/xwp/wp-customize-posts/subscription","commits_url":"https://api.github.com/repos/xwp/wp-customize-posts/commits{/sha}","git_commits_url":"https://api.github.com/repos/xwp/wp-customize-posts/git/commits{/sha}","comments_url":"https://api.github.com/repos/xwp/wp-customize-posts/comments{/number}","issue_comment_url":"https://api.github.com/repos/xwp/wp-customize-posts/issues/comments{/number}","contents_url":"https://api.github.com/repos/xwp/wp-customize-posts/contents/{+path}","compare_url":"https://api.github.com/repos/xwp/wp-customize-posts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xwp/wp-customize-posts/merges","archive_url":"https://api.github.com/repos/xwp/wp-customize-posts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xwp/wp-customize-posts/downloads","issues_url":"https://api.github.com/repos/xwp/wp-customize-posts/issues{/number}","pulls_url":"https://api.github.com/repos/xwp/wp-customize-posts/pulls{/number}","milestones_url":"https://api.github.com/repos/xwp/wp-customize-posts/milestones{/number}","notifications_url":"https://api.github.com/repos/xwp/wp-customize-posts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xwp/wp-customize-posts/labels{/name}","releases_url":"https://api.github.com/repos/xwp/wp-customize-posts/releases{/id}","deployments_url":"https://api.github.com/repos/xwp/wp-customize-posts/deployments","created_at":"2014-05-04T06:57:25Z","updated_at":"2016-04-27T06:18:54Z","pushed_at":"2016-04-28T06:00:43Z","git_url":"git://github.com/xwp/wp-customize-posts.git","ssh_url":"git@github.com:xwp/wp-customize-posts.git","clone_url":"https://github.com/xwp/wp-customize-posts.git","svn_url":"https://github.com/xwp/wp-customize-posts","homepage":"https://wordpress.org/plugins/customize-posts/","size":1478,"stargazers_count":55,"watchers_count":55,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":42,"forks":11,"open_issues":42,"watchers":55,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/xwp/wp-customize-posts/pulls/115"},"html":{"href":"https://github.com/xwp/wp-customize-posts/pull/115"},"issue":{"href":"https://api.github.com/repos/xwp/wp-customize-posts/issues/115"},"comments":{"href":"https://api.github.com/repos/xwp/wp-customize-posts/issues/115/comments"},"review_comments":{"href":"https://api.github.com/repos/xwp/wp-customize-posts/pulls/115/comments"},"review_comment":{"href":"https://api.github.com/repos/xwp/wp-customize-posts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xwp/wp-customize-posts/pulls/115/commits"},"statuses":{"href":"https://api.github.com/repos/xwp/wp-customize-posts/statuses/8a501de0f30b9506007fe3754ee2b4d436fb2556"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":1,"changed_files":1}}