{"action":"created","issue":{"url":"https://api.github.com/repos/woocommerce/woocommerce/issues/19114","repository_url":"https://api.github.com/repos/woocommerce/woocommerce","labels_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/19114/labels{/name}","comments_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/19114/comments","events_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/19114/events","html_url":"https://github.com/woocommerce/woocommerce/issues/19114","id":299833944,"number":19114,"title":"Rest API: Missing first product when using 'include' and array.","user":{"login":"claudiulodro","id":7317227,"avatar_url":"https://avatars3.githubusercontent.com/u/7317227?v=4","gravatar_id":"","url":"https://api.github.com/users/claudiulodro","html_url":"https://github.com/claudiulodro","followers_url":"https://api.github.com/users/claudiulodro/followers","following_url":"https://api.github.com/users/claudiulodro/following{/other_user}","gists_url":"https://api.github.com/users/claudiulodro/gists{/gist_id}","starred_url":"https://api.github.com/users/claudiulodro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudiulodro/subscriptions","organizations_url":"https://api.github.com/users/claudiulodro/orgs","repos_url":"https://api.github.com/users/claudiulodro/repos","events_url":"https://api.github.com/users/claudiulodro/events{/privacy}","received_events_url":"https://api.github.com/users/claudiulodro/received_events","type":"User","site_admin":false},"labels":[{"id":33006826,"url":"https://api.github.com/repos/woocommerce/woocommerce/labels/Focus:%20API","name":"Focus: API","color":"fef2c0","default":false},{"id":152990,"url":"https://api.github.com/repos/woocommerce/woocommerce/labels/Type:%20Bug","name":"Type: Bug","color":"F21B3F","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-23T20:04:09Z","updated_at":"2018-02-23T21:34:08Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I ran into this while working on the Products block. It's not a blocker or anything; I can just use the comma-separated version of the API call.\r\n\r\n(all of these are valid products and exist)\r\n\r\n1. For the following API call: `http://local.wordpress.test/wp-json/wc/v2/products?per_page=3&include=[808,798,797]&orderby=include` I get info on two products for the result: Ones with IDs 798 and 797. The first product in the list is always missing.\r\n\r\n<img width=\"789\" alt=\"screen shot 2018-02-23 at 12 01 08 pm\" src=\"https://user-images.githubusercontent.com/7317227/36614369-4872a534-1891-11e8-90fe-2688f16d20df.png\">\r\n\r\n2. For the following API call: `http://local.wordpress.test/wp-json/wc/v2/products?per_page=3&include=808,798,797&orderby=include` I get all three products back.\r\n\r\n<img width=\"736\" alt=\"screen shot 2018-02-23 at 12 00 48 pm\" src=\"https://user-images.githubusercontent.com/7317227/36614377-5261734a-1891-11e8-9227-f65d14e5637b.png\">\r\n\r\nI expect them to give identical results (or at least the array version to work correctly since it's the documented way of doing it)."},"comment":{"url":"https://api.github.com/repos/woocommerce/woocommerce/issues/comments/368144826","html_url":"https://github.com/woocommerce/woocommerce/issues/19114#issuecomment-368144826","issue_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/19114","id":368144826,"user":{"login":"WPprodigy","id":8536129,"avatar_url":"https://avatars2.githubusercontent.com/u/8536129?v=4","gravatar_id":"","url":"https://api.github.com/users/WPprodigy","html_url":"https://github.com/WPprodigy","followers_url":"https://api.github.com/users/WPprodigy/followers","following_url":"https://api.github.com/users/WPprodigy/following{/other_user}","gists_url":"https://api.github.com/users/WPprodigy/gists{/gist_id}","starred_url":"https://api.github.com/users/WPprodigy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPprodigy/subscriptions","organizations_url":"https://api.github.com/users/WPprodigy/orgs","repos_url":"https://api.github.com/users/WPprodigy/repos","events_url":"https://api.github.com/users/WPprodigy/events{/privacy}","received_events_url":"https://api.github.com/users/WPprodigy/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T21:34:08Z","updated_at":"2018-02-23T21:34:08Z","author_association":"MEMBER","body":"Not 100% sure what the best way to proceed is though.\r\n\r\n1) Drop support for `[]` syntax in the URL (just docs update)\r\n2) Create `wc_parse_id_list` helper function and use that instead.\r\n3) Along with 2, maybe open up an issue WP trac, since it does seem like buggy regex."}}
{"actor":{"display_login":"WPprodigy"}}