{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/22867","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/22867/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/22867/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/22867/events","html_url":"https://github.com/symfony/symfony/pull/22867","id":230629789,"number":22867,"title":"[PropertyAccess] writeCollection: $key loop iterator as second parameter of $addMethod method called.","user":{"login":"StevioStudio","id":25152680,"avatar_url":"https://avatars2.githubusercontent.com/u/25152680?v=4","gravatar_id":"","url":"https://api.github.com/users/StevioStudio","html_url":"https://github.com/StevioStudio","followers_url":"https://api.github.com/users/StevioStudio/followers","following_url":"https://api.github.com/users/StevioStudio/following{/other_user}","gists_url":"https://api.github.com/users/StevioStudio/gists{/gist_id}","starred_url":"https://api.github.com/users/StevioStudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevioStudio/subscriptions","organizations_url":"https://api.github.com/users/StevioStudio/orgs","repos_url":"https://api.github.com/users/StevioStudio/repos","events_url":"https://api.github.com/users/StevioStudio/events{/privacy}","received_events_url":"https://api.github.com/users/StevioStudio/received_events","type":"User","site_admin":false},"labels":[{"id":100378,"url":"https://api.github.com/repos/symfony/symfony/labels/Feature","name":"Feature","color":"02e10c","default":false},{"id":28502152,"url":"https://api.github.com/repos/symfony/symfony/labels/PropertyAccess","name":"PropertyAccess","color":"DDDDDD","default":false},{"id":207439722,"url":"https://api.github.com/repos/symfony/symfony/labels/Ready","name":"Ready","color":"009800","default":false},{"id":237003792,"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/symfony/symfony/milestones/10","html_url":"https://github.com/symfony/symfony/milestone/10","labels_url":"https://api.github.com/repos/symfony/symfony/milestones/10/labels","id":2117464,"number":10,"title":"3.4","description":"https://symfony.com/roadmap?version=3.4#checker","creator":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars3.githubusercontent.com/u/73419?v=4","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":412,"state":"open","created_at":"2016-11-06T20:24:23Z","updated_at":"2017-10-12T18:31:24Z","due_on":"2017-11-30T08:00:00Z","closed_at":null},"comments":16,"created_at":"2017-05-23T08:37:32Z","updated_at":"2017-10-12T18:32:01Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/22867","html_url":"https://github.com/symfony/symfony/pull/22867","diff_url":"https://github.com/symfony/symfony/pull/22867.diff","patch_url":"https://github.com/symfony/symfony/pull/22867.patch"},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| License       | MIT\r\n\r\nIn method writeCollection, added `$key` (loop index iterator) as second parameter of `{$addMethod}` method called.\r\nThis extra information allow to fix a problem in Symfony Form CollectionType that lose CollectionElement Index when adding new elements.\r\n\r\nWith this, when setting `by_reference` to `false` option in CollectionType it will prevent Form Error to lose its key reference the key element of the collection.\r\nThe `addMethod` of the entity will be structured like This.\r\n\r\n```\r\n /**\r\n * Add blockArray\r\n *\r\n * @param PostBlock $blockArray\r\n * @param int       $index\r\n *\r\n * @return $this\r\n */\r\npublic function addBlockArray(PostBlock $blockArray, $index = NULL)\r\n{\r\n    if (NULL !== $index) {\r\n        $this->blockArray[$index] = $blockArray;\r\n    } else {\r\n        $this->blockArray[] = $blockArray;\r\n    }\r\n    $blockArray->setPost($this);\r\n    return $this;\r\n}\r\n```\r\n\r\nI'm missing something or there is no strongest reason for not to pass `$key` as second parameter of `{$addMethod}`?\r\nThanks,\r\nCristoforo"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/336226302","html_url":"https://github.com/symfony/symfony/pull/22867#issuecomment-336226302","issue_url":"https://api.github.com/repos/symfony/symfony/issues/22867","id":336226302,"user":{"login":"StevioStudio","id":25152680,"avatar_url":"https://avatars2.githubusercontent.com/u/25152680?v=4","gravatar_id":"","url":"https://api.github.com/users/StevioStudio","html_url":"https://github.com/StevioStudio","followers_url":"https://api.github.com/users/StevioStudio/followers","following_url":"https://api.github.com/users/StevioStudio/following{/other_user}","gists_url":"https://api.github.com/users/StevioStudio/gists{/gist_id}","starred_url":"https://api.github.com/users/StevioStudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevioStudio/subscriptions","organizations_url":"https://api.github.com/users/StevioStudio/orgs","repos_url":"https://api.github.com/users/StevioStudio/repos","events_url":"https://api.github.com/users/StevioStudio/events{/privacy}","received_events_url":"https://api.github.com/users/StevioStudio/received_events","type":"User","site_admin":false},"created_at":"2017-10-12T18:32:01Z","updated_at":"2017-10-12T18:32:01Z","author_association":"NONE","body":"@xabbuh I agree. But I did not find another est to fix tue huge problem that I show in my PDF."}}
{"actor":{"display_login":"StevioStudio"}}