{"action":"created","issue":{"url":"https://api.github.com/repos/rilwis/meta-box/issues/875","repository_url":"https://api.github.com/repos/rilwis/meta-box","labels_url":"https://api.github.com/repos/rilwis/meta-box/issues/875/labels{/name}","comments_url":"https://api.github.com/repos/rilwis/meta-box/issues/875/comments","events_url":"https://api.github.com/repos/rilwis/meta-box/issues/875/events","html_url":"https://github.com/rilwis/meta-box/issues/875","id":156845605,"number":875,"title":"image advanced field within clone group index off by 1","user":{"login":"andrewfrankel","id":1470345,"avatar_url":"https://avatars.githubusercontent.com/u/1470345?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewfrankel","html_url":"https://github.com/andrewfrankel","followers_url":"https://api.github.com/users/andrewfrankel/followers","following_url":"https://api.github.com/users/andrewfrankel/following{/other_user}","gists_url":"https://api.github.com/users/andrewfrankel/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewfrankel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewfrankel/subscriptions","organizations_url":"https://api.github.com/users/andrewfrankel/orgs","repos_url":"https://api.github.com/users/andrewfrankel/repos","events_url":"https://api.github.com/users/andrewfrankel/events{/privacy}","received_events_url":"https://api.github.com/users/andrewfrankel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rilwis/meta-box/labels/in%20progress","name":"in progress","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"rilwis","id":668274,"avatar_url":"https://avatars.githubusercontent.com/u/668274?v=3","gravatar_id":"","url":"https://api.github.com/users/rilwis","html_url":"https://github.com/rilwis","followers_url":"https://api.github.com/users/rilwis/followers","following_url":"https://api.github.com/users/rilwis/following{/other_user}","gists_url":"https://api.github.com/users/rilwis/gists{/gist_id}","starred_url":"https://api.github.com/users/rilwis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rilwis/subscriptions","organizations_url":"https://api.github.com/users/rilwis/orgs","repos_url":"https://api.github.com/users/rilwis/repos","events_url":"https://api.github.com/users/rilwis/events{/privacy}","received_events_url":"https://api.github.com/users/rilwis/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-05-25T20:42:33Z","updated_at":"2016-05-26T18:22:47Z","closed_at":null,"body":"**Summary**\r\n\r\nWhen using a cloned group containing an image_advanced field any newly added images have an index value that is one less than is correct. This results in the first newly added image to disappear after save since it's value is tacked onto the previous item in the cloned set.\r\n\r\n**Example Data**\r\n\r\nInitially created input after clicking 'add more' is correct (index 2): \r\n`<input disabled=\"\" class=\"rwmb-image_advanced\" name=\"logos[2][logo_jpg][]\" type=\"hidden\" value=\"\">`\r\n\r\nAfter adding image, newly created input field index is off (index 1):\r\n`<input type=\"hidden\" name=\"logos[1][logo_jpg][]\" value=\"871\" class=\"rwmb-media-input\">`\r\n\r\nThis is true for all subsequently added images.\r\n\r\nOn save, the post data winds up with the duplicate value for index 1:\r\n```\r\nlogos[0][logo_jpg][]:905\r\nlogos[1][logo_jpg][]:898\r\nlogos[1][logo_jpg][]:871\r\nlogos[2][logo_jpg][]:865\r\n```\r\n\r\nThe duplicate value is set to index 1 after the page returns from saving:\r\n`<input disabled=\"\" class=\"rwmb-image_advanced\" name=\"logos[1][logo_jpg][]\" type=\"hidden\" value=\"898,871\">`\r\n\r\n\r\n**I haven't had much time to dig into the code, but if you could point me in the right direction I would be happy to resolve and submit a pull request**\r\n"},"comment":{"url":"https://api.github.com/repos/rilwis/meta-box/issues/comments/221953196","html_url":"https://github.com/rilwis/meta-box/issues/875#issuecomment-221953196","issue_url":"https://api.github.com/repos/rilwis/meta-box/issues/875","id":221953196,"user":{"login":"andrewfrankel","id":1470345,"avatar_url":"https://avatars.githubusercontent.com/u/1470345?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewfrankel","html_url":"https://github.com/andrewfrankel","followers_url":"https://api.github.com/users/andrewfrankel/followers","following_url":"https://api.github.com/users/andrewfrankel/following{/other_user}","gists_url":"https://api.github.com/users/andrewfrankel/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewfrankel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewfrankel/subscriptions","organizations_url":"https://api.github.com/users/andrewfrankel/orgs","repos_url":"https://api.github.com/users/andrewfrankel/repos","events_url":"https://api.github.com/users/andrewfrankel/events{/privacy}","received_events_url":"https://api.github.com/users/andrewfrankel/received_events","type":"User","site_admin":false},"created_at":"2016-05-26T18:22:47Z","updated_at":"2016-05-26T18:22:47Z","body":"@rilwis, some additional info, that might be related. Had another bug with a color field contained within a cloned group. When you click the 'add more' button the color selector doesn't appear in the newly created group. Works fine using a text field type, or if the color field is standalone (not in a group). Let me know if you need any additional data.\r\n\r\n## Color field in clone group - broken\r\n<img width=\"589\" alt=\"screen shot 2016-05-26 at 12 03 33 pm\" src=\"https://cloud.githubusercontent.com/assets/1470345/15585356/17774792-233c-11e6-83b8-cb9fa9d68e36.png\">\r\n\r\n## Text field in clone group - works\r\n<img width=\"599\" alt=\"screen shot 2016-05-26 at 12 04 01 pm\" src=\"https://cloud.githubusercontent.com/assets/1470345/15585357/177a2a3e-233c-11e6-91dd-fa83aae39590.png\">\r\n\r\n## Color field standalone as a clone - works\r\n<img width=\"600\" alt=\"screen shot 2016-05-26 at 12 03 07 pm\" src=\"https://cloud.githubusercontent.com/assets/1470345/15585355/1776c6b4-233c-11e6-9b6e-74a68a52ea6c.png\">\r\n"}}
{"actor":{"display_login":"andrewfrankel"}}