{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/9687","repository_url":"https://api.github.com/repos/cakephp/cakephp","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/9687/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/9687/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/9687/events","html_url":"https://github.com/cakephp/cakephp/issues/9687","id":186536130,"number":9687,"title":"Bug in deleteAll() ?","user":{"login":"tom76dc","id":21366536,"avatar_url":"https://avatars.githubusercontent.com/u/21366536?v=3","gravatar_id":"","url":"https://api.github.com/users/tom76dc","html_url":"https://github.com/tom76dc","followers_url":"https://api.github.com/users/tom76dc/followers","following_url":"https://api.github.com/users/tom76dc/following{/other_user}","gists_url":"https://api.github.com/users/tom76dc/gists{/gist_id}","starred_url":"https://api.github.com/users/tom76dc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tom76dc/subscriptions","organizations_url":"https://api.github.com/users/tom76dc/orgs","repos_url":"https://api.github.com/users/tom76dc/repos","events_url":"https://api.github.com/users/tom76dc/events{/privacy}","received_events_url":"https://api.github.com/users/tom76dc/received_events","type":"User","site_admin":false},"labels":[{"id":60504544,"url":"https://api.github.com/repos/cakephp/cakephp/labels/Defect","name":"Defect","color":"f7c6c7","default":false},{"id":60525626,"url":"https://api.github.com/repos/cakephp/cakephp/labels/On%20hold","name":"On hold","color":"eb6420","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/110","html_url":"https://github.com/cakephp/cakephp/milestones/3.3.8","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/110/labels","id":2100927,"number":110,"title":"3.3.8","description":"Bugfixes and minor features for 3.3.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":34,"closed_issues":12,"state":"open","created_at":"2016-10-29T02:05:55Z","updated_at":"2016-11-01T18:59:27Z","due_on":"2016-11-11T00:00:00Z","closed_at":null},"comments":4,"created_at":"2016-11-01T13:40:09Z","updated_at":"2016-11-01T22:18:45Z","closed_at":"2016-11-01T18:59:27Z","body":"This is a (multiple allowed):\r\n* [x] bug\r\n* [ ] enhancement\r\n* [ ] feature-discussion (RFC)\r\n\r\n* CakePHP Version: 3.3.6\r\n* Platform and Target: NGINX,MYSQL INNODB Tables\r\n\r\n\r\nHello,\r\nIn the documentation if find that\r\n- delete : will delete associated data when HasMany associations are configured as dependent\r\n- deleteAll : will delete all associated data\r\n\r\nWhen i \r\n- Use delete() **with** 'dependent' => true in the model, the referenced data is deleted in the other table\r\n- Use deleteAll(), the delete does not work\r\n\r\nIs this because of the constraint i added ?\r\nDid i misunderstand the documentation that deleteAll deletes associated data anyway ?  or is this a bug in deleteAll?\r\n\r\n\r\n\r\nThe Error message i receive is\r\n`Argument 1 passed to Cake\\Database\\Expression\\QueryExpression::_addConditions() must be of the type array, object given, called in /var/www/nginx.local/cakephp/vendor/cakephp/cakephp/src/Database/Expression/QueryExpression.php on line 140`\r\n\r\nI setup 2 tables to test this. \r\ntables : clients, addresses . \r\n\r\n```sql\r\nCREATE TABLE `clients` (\r\n  `id` int(11) NOT NULL,\r\n  `name` varchar(50) COLLATE utf8_bin NOT NULL\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;\r\n\r\n\r\nCREATE TABLE `addresses` (\r\n  `id` int(11) NOT NULL,\r\n  `name` varchar(50) COLLATE utf8_bin NOT NULL,\r\n  `client_id` int(11) NOT NULL\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;\r\nALTER TABLE `addresses`\r\n  ADD CONSTRAINT `addresses_ibfk_1` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`);\r\n```\r\n\r\nregards,\r\nTom\r\n"},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/257716150","html_url":"https://github.com/cakephp/cakephp/issues/9687#issuecomment-257716150","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/9687","id":257716150,"user":{"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},"created_at":"2016-11-01T22:18:45Z","updated_at":"2016-11-01T22:18:45Z","body":"Ah. That is trying to say that when an entity is deleted, and deletes are cascaded, the cascade is done via deleteAll(). Not that deleteAll() cascades."}}
{"actor":{"display_login":"markstory"}}