{"action":"closed","issue":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3904","labels_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3904/labels{/name}","comments_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3904/comments","events_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3904/events","html_url":"https://github.com/bcit-ci/CodeIgniter/issues/3904","id":87359187,"number":3904,"title":"Callbacks not run on empty fields in some situations","user":{"login":"jamieburchell","id":3270426,"avatar_url":"https://avatars.githubusercontent.com/u/3270426?v=3","gravatar_id":"","url":"https://api.github.com/users/jamieburchell","html_url":"https://github.com/jamieburchell","followers_url":"https://api.github.com/users/jamieburchell/followers","following_url":"https://api.github.com/users/jamieburchell/following{/other_user}","gists_url":"https://api.github.com/users/jamieburchell/gists{/gist_id}","starred_url":"https://api.github.com/users/jamieburchell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamieburchell/subscriptions","organizations_url":"https://api.github.com/users/jamieburchell/orgs","repos_url":"https://api.github.com/users/jamieburchell/repos","events_url":"https://api.github.com/users/jamieburchell/events{/privacy}","received_events_url":"https://api.github.com/users/jamieburchell/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-11T14:06:37Z","updated_at":"2015-06-11T14:44:44Z","closed_at":"2015-06-11T14:44:44Z","body":"Using latest stable CI3 version this code does not run the validation callback if the `image` field is empty:\r\n\r\n```\r\n$this->form_validation->set_rules('image', 'Image', [\r\n\t'trim',\r\n\t[\r\n\t\t'upload_image',\r\n\t\t[$this, 'upload_image']\r\n\t]\r\n]);\r\n```\r\n\r\nThis format does:\r\n\r\n```\r\n$this->form_validation->set_rules('image', 'Image', [\r\n\t'trim',\r\n\tfunction($value) {\r\n\t\t$this->upload_image();\r\n\t}\r\n]);\r\n```"}}