{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/8001","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/8001/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/8001/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/8001/events","html_url":"https://github.com/cakephp/cakephp/issues/8001","id":125812808,"number":8001,"title":"[FatalErrorException] Call to a member function format() on array","user":{"login":"mkornatzki","id":16632594,"avatar_url":"https://avatars.githubusercontent.com/u/16632594?v=3","gravatar_id":"","url":"https://api.github.com/users/mkornatzki","html_url":"https://github.com/mkornatzki","followers_url":"https://api.github.com/users/mkornatzki/followers","following_url":"https://api.github.com/users/mkornatzki/following{/other_user}","gists_url":"https://api.github.com/users/mkornatzki/gists{/gist_id}","starred_url":"https://api.github.com/users/mkornatzki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkornatzki/subscriptions","organizations_url":"https://api.github.com/users/mkornatzki/orgs","repos_url":"https://api.github.com/users/mkornatzki/repos","events_url":"https://api.github.com/users/mkornatzki/events{/privacy}","received_events_url":"https://api.github.com/users/mkornatzki/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/Defect","name":"Defect","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/72","html_url":"https://github.com/cakephp/cakephp/milestones/3.1.8","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/72/labels","id":1495135,"number":72,"title":"3.1.8","description":"Bugfixes and optimizations for 3.1.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":28,"closed_issues":3,"state":"open","created_at":"2016-01-10T00:26:12Z","updated_at":"2016-01-10T11:11:33Z","due_on":"2016-01-30T05:00:00Z","closed_at":null},"comments":4,"created_at":"2016-01-10T10:53:37Z","updated_at":"2016-01-10T11:15:21Z","closed_at":null,"body":"Hi,\r\ni do create all the neccessary files for a table \"updates\" with \"cake bake all updates\".\r\nIf i want to edit the data with the automatically created screens i get the following eror:\r\nin Logfile: Error: [Cake\\Error\\FatalErrorException] Call to a member function format() on array\r\non Website: Error: Call to a member function format() on array\r\n  File C:\\Work\\webserver\\site\\vendor\\cakephp\\cakephp\\src\\Database\\Type\\DateTimeType.php\r\n  Line: 97 \r\n\r\nOther sites baked like the site above worked without problems.\r\n\r\nI try to find the problem (i am new to cakePhp) and found out that the unique validation makes the problem.\r\n        $validator\r\n            ->add('release_dat', 'valid', ['rule' => 'datetime'])\r\n            ->allowEmpty('release_dat')\r\n            ->add('release_dat', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);\r\nIf i comment out the line with \"unique\" i can add and edit entities.\r\n\r\nI use cakePhp 3.1.5, php 5.6.16 and mySQL 5.0.11.\r\nIn the database a unique index is defined \"UNIQUE INDEX release_dat_UNIQUE (release_dat)\"\r\n\r\nIs this a bug or do i have to configure something?\r\n\r\ncheers, michael\r\n\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/170335406","html_url":"https://github.com/cakephp/cakephp/issues/8001#issuecomment-170335406","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/8001","id":170335406,"user":{"login":"lorenzo","id":37621,"avatar_url":"https://avatars.githubusercontent.com/u/37621?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenzo","html_url":"https://github.com/lorenzo","followers_url":"https://api.github.com/users/lorenzo/followers","following_url":"https://api.github.com/users/lorenzo/following{/other_user}","gists_url":"https://api.github.com/users/lorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzo/subscriptions","organizations_url":"https://api.github.com/users/lorenzo/orgs","repos_url":"https://api.github.com/users/lorenzo/repos","events_url":"https://api.github.com/users/lorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzo/received_events","type":"User","site_admin":false},"created_at":"2016-01-10T11:15:21Z","updated_at":"2016-01-10T11:15:21Z","body":"It actually looks like you are validating the uniqueness of a date filed, that was posted as an array. I don't think that is currently supported. While this bug is being investigated, I suggest moving your validation to have a `isUnique()` call in the `buildRules` method of your table.\r\n\r\nIt will have the same effect, but won't trigger any errors."}}