{"action":"created","issue":{"url":"https://api.github.com/repos/digi604/django-smart-selects/issues/253","repository_url":"https://api.github.com/repos/digi604/django-smart-selects","labels_url":"https://api.github.com/repos/digi604/django-smart-selects/issues/253/labels{/name}","comments_url":"https://api.github.com/repos/digi604/django-smart-selects/issues/253/comments","events_url":"https://api.github.com/repos/digi604/django-smart-selects/issues/253/events","html_url":"https://github.com/digi604/django-smart-selects/issues/253","id":306139099,"number":253,"title":"bindfields.js:14 Uncaught ReferenceError: chainedfk is not defined - Django Admin","user":{"login":"chris-jones","id":1416392,"avatar_url":"https://avatars0.githubusercontent.com/u/1416392?v=4","gravatar_id":"","url":"https://api.github.com/users/chris-jones","html_url":"https://github.com/chris-jones","followers_url":"https://api.github.com/users/chris-jones/followers","following_url":"https://api.github.com/users/chris-jones/following{/other_user}","gists_url":"https://api.github.com/users/chris-jones/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-jones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-jones/subscriptions","organizations_url":"https://api.github.com/users/chris-jones/orgs","repos_url":"https://api.github.com/users/chris-jones/repos","events_url":"https://api.github.com/users/chris-jones/events{/privacy}","received_events_url":"https://api.github.com/users/chris-jones/received_events","type":"User","site_admin":false},"labels":[{"id":460785861,"url":"https://api.github.com/repos/digi604/django-smart-selects/labels/Needs%20feedback","name":"Needs feedback","color":"f9d0c4","default":false},{"id":460785789,"url":"https://api.github.com/repos/digi604/django-smart-selects/labels/Possibly%20fixed","name":"Possibly fixed","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-03-17T08:28:45Z","updated_at":"2018-04-09T13:47:09Z","closed_at":null,"author_association":"NONE","body":"## Checklist\r\n<sup><sup>Put an `x` in the bracket when you have completed each task, like this: `[x]`</sup></sup>\r\n\r\n- [x] This issue is not about installing previous versions of django-smart-selects older than 1.2.8. I understand that previous versions are insecure and will not receive any support whatsoever.\r\n- [x] I have verified that that issue exists against the `master` branch of django-smart-selects.\r\n- [x] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.\r\n- [x] I have debugged the issue to the `smart_selects` app.\r\n- [x] I have reduced the issue to the simplest possible case.\r\n- [x] I have included all relevant sections of `models.py`, `forms.py`, and `views.py` with problems.\r\n- [x] I have used [GitHub Flavored Markdown](https://help.github.com/articles/creating-and-highlighting-code-blocks/) to style all of my posted code.\r\n\r\nError received within Google Chrome when loading Django admin page of a model with an inline model which uses smart-selects.\r\n\r\n```JavaScript\r\nbindfields.js:14 Uncaught ReferenceError: chainedfk is not defined\r\n    at initItem (bindfields.js:14)\r\n    at HTMLSelectElement.<anonymous> (bindfields.js:35)\r\n    at Function.each (jquery-2.2.0.js:360)\r\n    at HTMLDocument.<anonymous> (bindfields.js:34)\r\n    at fire (jquery-2.2.0.js:3182)\r\n    at Object.fireWith [as resolveWith] (jquery-2.2.0.js:3312)\r\n    at Function.ready (jquery-2.2.0.js:3531)\r\n    at HTMLDocument.completed (jquery-2.2.0.js:3547)\r\n```\r\n\r\n## Steps to reproduce\r\nEnvironment:\r\n- Django 1.10.7\r\n- Latest build django-smart-selects\r\n- Jquery (2.2.0 / 2.2.3 / 2.2.4 / 3.3.1) (multiple versions tested)\r\n\r\n1. Configured Django Instance as specified in the installation and configuration guides.\r\n2. Smart Selects used on a Model, which is present as an InlineForm on another model Admin page \r\n3. Load page\r\n\r\n## Actual behavior\r\nNothing. Error in Javascript prevents the code being actioned.\r\n\r\n## Expected behavior\r\nSmart-selects should load two fields normally, and provide smart select functionality between them.\r\n\r\nI actually removed all other Javascript references and inline javascript code from the HTML in order to check that there wasn't a conflicting code issue, but found nothing.\r\n\r\nThe script files are loaded in the correct order, none are 404-ing:\r\n\r\n```HTML\r\n<script type=\"text/javascript\" src=\"/admin/jsi18n/\"></script>\r\n <script type=\"text/javascript\" src=\"/static/admin/js/core.js\"></script>\r\n <script type=\"text/javascript\" src=\"/static/admin/js/vendor/jquery/jquery.js\"></script>\r\n <script type=\"text/javascript\" src=\"/static/admin/js/jquery.init.js\"></script>\r\n <script type=\"text/javascript\" src=\"/static/admin/js/admin/RelatedObjectLookups.js\"></script>\r\n <script type=\"text/javascript\" src=\"/static/admin/js/actions.js\"></script>\r\n <script type=\"text/javascript\" src=\"/static/admin/js/urlify.js\"></script>\r\n <script type=\"text/javascript\" src=\"/static/admin/js/prepopulate.js\"></script>\r\n <script type=\"text/javascript\" src=\"/static/admin/js/vendor/xregexp/xregexp.js\"></script>\r\n\r\n <script type=\"text/javascript\" src=\"/static/smart-selects/admin/js/chainedfk.js\"></script>\r\n <script type=\"text/javascript\" src=\"/static/smart-selects/admin/js/bindfields.js\"></script>\r\n\r\n <script type=\"text/javascript\" src=\"/static/admin/js/calendar.js\"></script>\r\n <script type=\"text/javascript\" src=\"/static/admin/js/admin/DateTimeShortcuts.js\"></script>\r\n```\r\nCan't for the life of me see what's wrong. I think the error being thrown-up might be misleading somehow? I even combined the smart-select Javascript together, so that there would be no scope issues."},"comment":{"url":"https://api.github.com/repos/digi604/django-smart-selects/issues/comments/379757803","html_url":"https://github.com/digi604/django-smart-selects/issues/253#issuecomment-379757803","issue_url":"https://api.github.com/repos/digi604/django-smart-selects/issues/253","id":379757803,"user":{"login":"crackjack","id":191368,"avatar_url":"https://avatars1.githubusercontent.com/u/191368?v=4","gravatar_id":"","url":"https://api.github.com/users/crackjack","html_url":"https://github.com/crackjack","followers_url":"https://api.github.com/users/crackjack/followers","following_url":"https://api.github.com/users/crackjack/following{/other_user}","gists_url":"https://api.github.com/users/crackjack/gists{/gist_id}","starred_url":"https://api.github.com/users/crackjack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crackjack/subscriptions","organizations_url":"https://api.github.com/users/crackjack/orgs","repos_url":"https://api.github.com/users/crackjack/repos","events_url":"https://api.github.com/users/crackjack/events{/privacy}","received_events_url":"https://api.github.com/users/crackjack/received_events","type":"User","site_admin":false},"created_at":"2018-04-09T13:47:09Z","updated_at":"2018-04-09T13:47:09Z","author_association":"NONE","body":"`$.getJSON` calls a `url`, the URL depends on the model name and the app name which finally calls one of the methods in `[views.py](https://github.com/digi604/django-smart-selects/blob/js-unlinting-fixes/smart_selects/views.py#L90)` that returns a JSON response with the error and the response objects."}}
{"actor":{"display_login":"crackjack"}}