{"action":"created","issue":{"url":"https://api.github.com/repos/woothemes/woocommerce/issues/11326","repository_url":"https://api.github.com/repos/woothemes/woocommerce","labels_url":"https://api.github.com/repos/woothemes/woocommerce/issues/11326/labels{/name}","comments_url":"https://api.github.com/repos/woothemes/woocommerce/issues/11326/comments","events_url":"https://api.github.com/repos/woothemes/woocommerce/issues/11326/events","html_url":"https://github.com/woothemes/woocommerce/issues/11326","id":163383061,"number":11326,"title":"Notice: Array to string conversion","user":{"login":"crazysnowflake","id":5089167,"avatar_url":"https://avatars.githubusercontent.com/u/5089167?v=3","gravatar_id":"","url":"https://api.github.com/users/crazysnowflake","html_url":"https://github.com/crazysnowflake","followers_url":"https://api.github.com/users/crazysnowflake/followers","following_url":"https://api.github.com/users/crazysnowflake/following{/other_user}","gists_url":"https://api.github.com/users/crazysnowflake/gists{/gist_id}","starred_url":"https://api.github.com/users/crazysnowflake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crazysnowflake/subscriptions","organizations_url":"https://api.github.com/users/crazysnowflake/orgs","repos_url":"https://api.github.com/users/crazysnowflake/repos","events_url":"https://api.github.com/users/crazysnowflake/events{/privacy}","received_events_url":"https://api.github.com/users/crazysnowflake/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/woothemes/woocommerce/labels/Bug","name":"Bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/woothemes/woocommerce/milestones/53","html_url":"https://github.com/woothemes/woocommerce/milestones/2.7","labels_url":"https://api.github.com/repos/woothemes/woocommerce/milestones/53/labels","id":1537224,"number":53,"title":"2.7","description":"2.7 will focus on API + CRUD improvements.","creator":{"login":"mikejolley","id":90977,"avatar_url":"https://avatars.githubusercontent.com/u/90977?v=3","gravatar_id":"","url":"https://api.github.com/users/mikejolley","html_url":"https://github.com/mikejolley","followers_url":"https://api.github.com/users/mikejolley/followers","following_url":"https://api.github.com/users/mikejolley/following{/other_user}","gists_url":"https://api.github.com/users/mikejolley/gists{/gist_id}","starred_url":"https://api.github.com/users/mikejolley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikejolley/subscriptions","organizations_url":"https://api.github.com/users/mikejolley/orgs","repos_url":"https://api.github.com/users/mikejolley/repos","events_url":"https://api.github.com/users/mikejolley/events{/privacy}","received_events_url":"https://api.github.com/users/mikejolley/received_events","type":"User","site_admin":false},"open_issues":40,"closed_issues":50,"state":"open","created_at":"2016-01-22T23:35:12Z","updated_at":"2016-08-03T20:37:11Z","due_on":"2016-08-30T22:00:00Z","closed_at":null},"comments":2,"created_at":"2016-07-01T12:12:21Z","updated_at":"2016-08-04T09:44:37Z","closed_at":"2016-07-27T13:11:47Z","body":"## EXPLANATION OF THE ISSUE\r\nError on the store page when `$_GET` is recursive array.\r\n \r\n\r\n> Notice: Array to string conversion \r\n\r\n## STEPS TO REPRODUCE THE ISSUE\r\n\r\nGo to the store page and add query to url\r\nExample: `site.com/shop/?uf[t][product_cat][value][0]=15&uf[t][product_cat][value][1]=10&uf[t][product_cat][rel]=OR&uf[m][_price][value][0]=0&uf[m][_price][value][1]=12950&uf[m][_price][rel]=BETWEEN`\r\n\r\n## A quickfix:\r\n\r\nadd new function:\r\n\r\n```\r\nfunction query_string_vars($key, $val)\r\n{\r\n\tif ( is_array( $val ) ) {\r\n\t\tforeach( $val as $index => $innerVal ) {\r\n\t\t\tquery_string_vars($key . '['.$index.']', $innerVal );\r\n\t\t}\r\n\t} else {\r\n\t\techo '<input type=\"hidden\" name=\"' . esc_attr( $key ) . '\" value=\"' . esc_attr( $val ) . '\" />';\r\n\t}\r\n}\r\n```\r\non the template file woocommerce\\templates\\loop\\orderby.php  replace lines 36-38 to\r\n```\r\nforeach( $val as $index => $innerVal ) {\r\n\tquery_string_vars($key . '['.$index.']', $innerVal );\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/woothemes/woocommerce/issues/comments/237505479","html_url":"https://github.com/woothemes/woocommerce/issues/11326#issuecomment-237505479","issue_url":"https://api.github.com/repos/woothemes/woocommerce/issues/11326","id":237505479,"user":{"login":"crazysnowflake","id":5089167,"avatar_url":"https://avatars.githubusercontent.com/u/5089167?v=3","gravatar_id":"","url":"https://api.github.com/users/crazysnowflake","html_url":"https://github.com/crazysnowflake","followers_url":"https://api.github.com/users/crazysnowflake/followers","following_url":"https://api.github.com/users/crazysnowflake/following{/other_user}","gists_url":"https://api.github.com/users/crazysnowflake/gists{/gist_id}","starred_url":"https://api.github.com/users/crazysnowflake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crazysnowflake/subscriptions","organizations_url":"https://api.github.com/users/crazysnowflake/orgs","repos_url":"https://api.github.com/users/crazysnowflake/repos","events_url":"https://api.github.com/users/crazysnowflake/events{/privacy}","received_events_url":"https://api.github.com/users/crazysnowflake/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T09:44:36Z","updated_at":"2016-08-04T09:44:36Z","body":"Thank you. But I found another related issue, when checking the excluded keys (in _wc_query_string_form_fields_ function)\r\n```\r\nif ( in_array( $key, $exclude ) ) {\r\n    continue;\r\n}\r\n```\r\nif key is '0' it will be skipped too, for fix this just need to add third parameter.\r\n```\r\nif ( in_array( $key, $exclude, empty($key) && $key !== '0' ) ) {\r\n   continue;\r\n}\r\n```"}}
{"actor":{"display_login":"crazysnowflake"}}