{"action":"created","issue":{"url":"https://api.github.com/repos/select2/select2/issues/2950","labels_url":"https://api.github.com/repos/select2/select2/issues/2950/labels{/name}","comments_url":"https://api.github.com/repos/select2/select2/issues/2950/comments","events_url":"https://api.github.com/repos/select2/select2/issues/2950/events","html_url":"https://github.com/select2/select2/issues/2950","id":54908648,"number":2950,"title":"Uncaught TypeError: Cannot read property 'slice' of undefined","user":{"login":"hendrixback","id":10588520,"avatar_url":"https://avatars.githubusercontent.com/u/10588520?v=3","gravatar_id":"","url":"https://api.github.com/users/hendrixback","html_url":"https://github.com/hendrixback","followers_url":"https://api.github.com/users/hendrixback/followers","following_url":"https://api.github.com/users/hendrixback/following{/other_user}","gists_url":"https://api.github.com/users/hendrixback/gists{/gist_id}","starred_url":"https://api.github.com/users/hendrixback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hendrixback/subscriptions","organizations_url":"https://api.github.com/users/hendrixback/orgs","repos_url":"https://api.github.com/users/hendrixback/repos","events_url":"https://api.github.com/users/hendrixback/events{/privacy}","received_events_url":"https://api.github.com/users/hendrixback/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/select2/select2/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/select2/select2/milestones/5","labels_url":"https://api.github.com/repos/select2/select2/milestones/5/labels","id":152312,"number":5,"title":"4.0","description":"This will be a complete rebuild of Select2, from the ground up.\r\n\r\n**Alpha** The Select2 4.0-alpha.1 release should be done by December 15th, 2014.\r\n\r\n**Beta:** The Select2 4.0-beta.1 release should be done by January 7th, 2014.","creator":{"login":"ivaynberg","id":150030,"avatar_url":"https://avatars.githubusercontent.com/u/150030?v=3","gravatar_id":"","url":"https://api.github.com/users/ivaynberg","html_url":"https://github.com/ivaynberg","followers_url":"https://api.github.com/users/ivaynberg/followers","following_url":"https://api.github.com/users/ivaynberg/following{/other_user}","gists_url":"https://api.github.com/users/ivaynberg/gists{/gist_id}","starred_url":"https://api.github.com/users/ivaynberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivaynberg/subscriptions","organizations_url":"https://api.github.com/users/ivaynberg/orgs","repos_url":"https://api.github.com/users/ivaynberg/repos","events_url":"https://api.github.com/users/ivaynberg/events{/privacy}","received_events_url":"https://api.github.com/users/ivaynberg/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":43,"state":"open","created_at":"2012-07-26T15:56:40Z","updated_at":"2015-01-21T19:49:21Z","due_on":"2015-01-31T05:00:00Z","closed_at":null},"comments":5,"created_at":"2015-01-20T16:55:41Z","updated_at":"2015-01-21T21:39:43Z","closed_at":null,"body":"I have updated to Beta 2 (was using beta 1) and know I am getting this!\r\n\r\n    $('#OccurrencesWorkers').select2({\r\n        placeholder: \"Search for Worker\",\r\n        ajax: {\r\n            url: '/HS/OccurrencesJSON.php?type=OccurrencesWorkers',\r\n            delay: 250,\r\n            dataType: 'json',\r\n            data: function (params) {\r\n                    var queryParameters = {\r\n                        q: params.term\r\n                    }\r\n                    return queryParameters;\r\n                }\r\n        }\r\n    }); \r\n\r\nJSON\r\n\r\n        $qry = $conn->prepare(\"SELECT \t PersonalNumber AS id,\r\n                                         CONCAT(PersonalNumber,' - ',name) AS text\r\n                                FROM\t tblinjured INNER JOIN tblsap\r\n                                ON       tblinjured.PersonalNumber = tblsap.SAP\r\n                                WHERE    CONCAT(PersonalNumber,' - ',name) LIKE :term\r\n                                GROUP BY PersonalNumber \r\n                                ORDER BY PersonalNumber\");\r\n\r\n        $qry->bindvalue(':term','%'.$_GET[\"q\"].'%',PDO::PARAM_STR);\r\n     \r\n        $qry -> execute();\r\n\r\n        $OccurrencesWorkers = $qry->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n        print json_encode($OccurrencesWorkers, JSON_NUMERIC_CHECK);\r\n\r\nHTML\r\n\r\nselect id=\"OccurrencesWorkers\" name=\"OccurrencesWorkers\" style=\"width: 100%\"></select"},"comment":{"url":"https://api.github.com/repos/select2/select2/issues/comments/70927064","html_url":"https://github.com/select2/select2/issues/2950#issuecomment-70927064","issue_url":"https://api.github.com/repos/select2/select2/issues/2950","id":70927064,"user":{"login":"kevin-brown","id":1991850,"avatar_url":"https://avatars.githubusercontent.com/u/1991850?v=3","gravatar_id":"","url":"https://api.github.com/users/kevin-brown","html_url":"https://github.com/kevin-brown","followers_url":"https://api.github.com/users/kevin-brown/followers","following_url":"https://api.github.com/users/kevin-brown/following{/other_user}","gists_url":"https://api.github.com/users/kevin-brown/gists{/gist_id}","starred_url":"https://api.github.com/users/kevin-brown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevin-brown/subscriptions","organizations_url":"https://api.github.com/users/kevin-brown/orgs","repos_url":"https://api.github.com/users/kevin-brown/repos","events_url":"https://api.github.com/users/kevin-brown/events{/privacy}","received_events_url":"https://api.github.com/users/kevin-brown/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T21:39:43Z","updated_at":"2015-01-21T21:39:43Z","body":"Your issue appears to be happening because you are not returning an object with the key `results` containing the list of objects. You can do this in your PHP backend, or in the `processResults` function [like we do in the GitHub example](https://select2.github.io/examples.html#data-ajax)."}}