{"action":"created","issue":{"url":"https://api.github.com/repos/isotope/core/issues/1658","repository_url":"https://api.github.com/repos/isotope/core","labels_url":"https://api.github.com/repos/isotope/core/issues/1658/labels{/name}","comments_url":"https://api.github.com/repos/isotope/core/issues/1658/comments","events_url":"https://api.github.com/repos/isotope/core/issues/1658/events","html_url":"https://github.com/isotope/core/issues/1658","id":158395257,"number":1658,"title":"Single checkbox attribute issue","user":{"login":"qzminski","id":193483,"avatar_url":"https://avatars.githubusercontent.com/u/193483?v=3","gravatar_id":"","url":"https://api.github.com/users/qzminski","html_url":"https://github.com/qzminski","followers_url":"https://api.github.com/users/qzminski/followers","following_url":"https://api.github.com/users/qzminski/following{/other_user}","gists_url":"https://api.github.com/users/qzminski/gists{/gist_id}","starred_url":"https://api.github.com/users/qzminski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qzminski/subscriptions","organizations_url":"https://api.github.com/users/qzminski/orgs","repos_url":"https://api.github.com/users/qzminski/repos","events_url":"https://api.github.com/users/qzminski/events{/privacy}","received_events_url":"https://api.github.com/users/qzminski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/isotope/core/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2016-06-03T15:37:23Z","updated_at":"2016-07-15T06:44:49Z","closed_at":null,"body":"If you create the attribute \"checkbox menu\" with a single option created via Options Manager, then you won't be able to check and save that field in the product settings. The reason is that the options manager creates the options array including the option database record ID and the option label:\r\n\r\n```php\r\n$GLOBALS['TL_DCA']['tl_iso_product']['fields']['my_field']['options'] = [\r\n    123 => 'My option',\r\n];\r\n```\r\n\r\nThat is correct for the multiple checkboxes but the single one gets **always** value=1, see:\r\n\r\nhttps://github.com/contao/core/blob/master/system/modules/core/widgets/CheckBox.php#L188\r\n\r\nThus when you attempt to save the record you will get ```Invalid input: 1``` error message because there is no option with key ```1```."},"comment":{"url":"https://api.github.com/repos/isotope/core/issues/comments/232874563","html_url":"https://github.com/isotope/core/issues/1658#issuecomment-232874563","issue_url":"https://api.github.com/repos/isotope/core/issues/1658","id":232874563,"user":{"login":"qzminski","id":193483,"avatar_url":"https://avatars.githubusercontent.com/u/193483?v=3","gravatar_id":"","url":"https://api.github.com/users/qzminski","html_url":"https://github.com/qzminski","followers_url":"https://api.github.com/users/qzminski/followers","following_url":"https://api.github.com/users/qzminski/following{/other_user}","gists_url":"https://api.github.com/users/qzminski/gists{/gist_id}","starred_url":"https://api.github.com/users/qzminski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qzminski/subscriptions","organizations_url":"https://api.github.com/users/qzminski/orgs","repos_url":"https://api.github.com/users/qzminski/repos","events_url":"https://api.github.com/users/qzminski/events{/privacy}","received_events_url":"https://api.github.com/users/qzminski/received_events","type":"User","site_admin":false},"created_at":"2016-07-15T06:44:49Z","updated_at":"2016-07-15T06:44:49Z","body":"Yup I think so. Remember that's only for backend ;-)"}}
{"actor":{"display_login":"qzminski"}}