{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/7367","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/7367/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/7367/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/7367/events","html_url":"https://github.com/cakephp/cakephp/issues/7367","id":105340178,"number":7367,"title":"Validation does not work when delete HTML code of fields on browser","user":{"login":"trungtan","id":4935326,"avatar_url":"https://avatars.githubusercontent.com/u/4935326?v=3","gravatar_id":"","url":"https://api.github.com/users/trungtan","html_url":"https://github.com/trungtan","followers_url":"https://api.github.com/users/trungtan/followers","following_url":"https://api.github.com/users/trungtan/following{/other_user}","gists_url":"https://api.github.com/users/trungtan/gists{/gist_id}","starred_url":"https://api.github.com/users/trungtan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trungtan/subscriptions","organizations_url":"https://api.github.com/users/trungtan/orgs","repos_url":"https://api.github.com/users/trungtan/repos","events_url":"https://api.github.com/users/trungtan/events{/privacy}","received_events_url":"https://api.github.com/users/trungtan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/documentation","name":"documentation","color":"FFFFFF"}],"state":"closed","locked":false,"assignee":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/59","html_url":"https://github.com/cakephp/cakephp/milestones/3.0.14","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/59/labels","id":1292952,"number":59,"title":"3.0.14","description":"Bugfixes and minor enhancements for 3.0.x","creator":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":9,"state":"open","created_at":"2015-09-07T02:11:05Z","updated_at":"2015-09-09T01:56:04Z","due_on":"2015-09-27T04:00:00Z","closed_at":null},"comments":4,"created_at":"2015-09-08T09:34:20Z","updated_at":"2015-09-09T02:08:18Z","closed_at":"2015-09-09T01:56:04Z","body":"My blog tutorial app has article table\r\n```\r\nCREATE TABLE IF NOT EXISTS `articles` (\r\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `title` varchar(50) DEFAULT NULL,\r\n  `body` text,\r\n  `created` datetime DEFAULT NULL,\r\n  `modified` datetime DEFAULT NULL,\r\n  `user_id` int(11) DEFAULT NULL,\r\n  PRIMARY KEY (`id`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;\r\n```\r\nand validator\r\n```\r\nclass ArticlesTable extends Table {\r\n    public function validationDefault(Validator $validator)\r\n    {\r\n        return $validator\r\n            ->notEmpty('title')\r\n            ->notEmpty('body');\r\n    }\r\n```\r\nIt worked fine when I inputed nothing. But when I tried to hack by deleting html code of title and body fields, using Firefox inspector, that submission had passed validation and added new record into database.\r\nDid I miss something or it's a bug?\r\nI'm using version 3.0.8."},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/138754773","html_url":"https://github.com/cakephp/cakephp/issues/7367#issuecomment-138754773","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/7367","id":138754773,"user":{"login":"trungtan","id":4935326,"avatar_url":"https://avatars.githubusercontent.com/u/4935326?v=3","gravatar_id":"","url":"https://api.github.com/users/trungtan","html_url":"https://github.com/trungtan","followers_url":"https://api.github.com/users/trungtan/followers","following_url":"https://api.github.com/users/trungtan/following{/other_user}","gists_url":"https://api.github.com/users/trungtan/gists{/gist_id}","starred_url":"https://api.github.com/users/trungtan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trungtan/subscriptions","organizations_url":"https://api.github.com/users/trungtan/orgs","repos_url":"https://api.github.com/users/trungtan/repos","events_url":"https://api.github.com/users/trungtan/events{/privacy}","received_events_url":"https://api.github.com/users/trungtan/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T02:08:18Z","updated_at":"2015-09-09T02:08:18Z","body":"Can I use callable function to validate presence by condition?\r\nI've tried \r\n```\r\n...\r\n        $validator\r\n            ->requirePresence('title', FALSE)\r\n            ->requirePresence('body', function ($context){\r\n                return FALSE;\r\n            })\r\n...\r\n```\r\nBut the body is still required."}}