{"action":"created","issue":{"url":"https://api.github.com/repos/mautic/mautic/issues/6542","repository_url":"https://api.github.com/repos/mautic/mautic","labels_url":"https://api.github.com/repos/mautic/mautic/issues/6542/labels{/name}","comments_url":"https://api.github.com/repos/mautic/mautic/issues/6542/comments","events_url":"https://api.github.com/repos/mautic/mautic/issues/6542/events","html_url":"https://github.com/mautic/mautic/pull/6542","id":358506908,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0MjI2MTE3","number":6542,"title":"Custom field clone fix","user":{"login":"escopecz","id":1235442,"node_id":"MDQ6VXNlcjEyMzU0NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1235442?v=4","gravatar_id":"","url":"https://api.github.com/users/escopecz","html_url":"https://github.com/escopecz","followers_url":"https://api.github.com/users/escopecz/followers","following_url":"https://api.github.com/users/escopecz/following{/other_user}","gists_url":"https://api.github.com/users/escopecz/gists{/gist_id}","starred_url":"https://api.github.com/users/escopecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escopecz/subscriptions","organizations_url":"https://api.github.com/users/escopecz/orgs","repos_url":"https://api.github.com/users/escopecz/repos","events_url":"https://api.github.com/users/escopecz/events{/privacy}","received_events_url":"https://api.github.com/users/escopecz/received_events","type":"User","site_admin":false},"labels":[{"id":154414515,"node_id":"MDU6TGFiZWwxNTQ0MTQ1MTU=","url":"https://api.github.com/repos/mautic/mautic/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":197691504,"node_id":"MDU6TGFiZWwxOTc2OTE1MDQ=","url":"https://api.github.com/repos/mautic/mautic/labels/Ready%20To%20Test","name":"Ready To Test","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mautic/mautic/milestones/48","html_url":"https://github.com/mautic/mautic/milestone/48","labels_url":"https://api.github.com/repos/mautic/mautic/milestones/48/labels","id":3624611,"node_id":"MDk6TWlsZXN0b25lMzYyNDYxMQ==","number":48,"title":"2.14.2","description":"","creator":{"login":"npracht","id":14075239,"node_id":"MDQ6VXNlcjE0MDc1MjM5","avatar_url":"https://avatars2.githubusercontent.com/u/14075239?v=4","gravatar_id":"","url":"https://api.github.com/users/npracht","html_url":"https://github.com/npracht","followers_url":"https://api.github.com/users/npracht/followers","following_url":"https://api.github.com/users/npracht/following{/other_user}","gists_url":"https://api.github.com/users/npracht/gists{/gist_id}","starred_url":"https://api.github.com/users/npracht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npracht/subscriptions","organizations_url":"https://api.github.com/users/npracht/orgs","repos_url":"https://api.github.com/users/npracht/repos","events_url":"https://api.github.com/users/npracht/events{/privacy}","received_events_url":"https://api.github.com/users/npracht/received_events","type":"User","site_admin":false},"open_issues":80,"closed_issues":1,"state":"open","created_at":"2018-09-05T13:39:45Z","updated_at":"2018-09-10T10:05:05Z","due_on":"2018-09-21T07:00:00Z","closed_at":null},"comments":0,"created_at":"2018-09-10T07:53:11Z","updated_at":"2018-09-12T12:02:57Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/mautic/mautic/pulls/6542","html_url":"https://github.com/mautic/mautic/pull/6542","diff_url":"https://github.com/mautic/mautic/pull/6542.diff","patch_url":"https://github.com/mautic/mautic/pull/6542.patch"},"body":"**Please be sure you are submitting this against the _staging_ branch.**\r\n\r\n[//]: # ( Please answer the following questions: )\r\n\r\n| Q  | A\r\n| --- | ---\r\n| Bug fix? | Y\r\n| New feature? | N\r\n| Automated tests included? | N \r\n| Related user documentation PR URL | /\r\n| Related developer documentation PR URL | /\r\n| Issues addressed (#s or URLs) | /\r\n| BC breaks? | N\r\n| Deprecations? | N\r\n\r\n[//]: # ( Note that all new features should have a related user and/or developer documentation PR in their respective repositories. )\r\n\r\n[//]: # ( Required: )\r\n#### Description:\r\nThe field cloning did not populate the values from the cloned field into the edit form. There are 2 problems:\r\n\r\n1. The cloning process is creating new field. The rest of Mautic's entities creates the new entity on save which is more sophisticated.\r\n2. When we consider 1. then the alias had to be unique. The save method in the model checks if the DB table column exists and if so the entity is not saved.\r\n\r\nSo the easy solution is to make the alias unique and keep the old way of cloning. That's how the current fix works. If we want to change it to the more sophisticated cloning than it would require more time.\r\n\r\n[//]: # ( As applicable: )\r\n#### Steps to reproduce the bug:\r\n1. Try to clone a custom field.\r\n2. It opens the edit form which is empty.\r\n\r\n#### Steps to test this PR:\r\n1. Try to clone a custom field.\r\n2. It opens the edit form which has new ID and the form is populated."},"comment":{"url":"https://api.github.com/repos/mautic/mautic/issues/comments/420622912","html_url":"https://github.com/mautic/mautic/pull/6542#issuecomment-420622912","issue_url":"https://api.github.com/repos/mautic/mautic/issues/6542","id":420622912,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDYyMjkxMg==","user":{"login":"swarnenduDutta","id":6310194,"node_id":"MDQ6VXNlcjYzMTAxOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/6310194?v=4","gravatar_id":"","url":"https://api.github.com/users/swarnenduDutta","html_url":"https://github.com/swarnenduDutta","followers_url":"https://api.github.com/users/swarnenduDutta/followers","following_url":"https://api.github.com/users/swarnenduDutta/following{/other_user}","gists_url":"https://api.github.com/users/swarnenduDutta/gists{/gist_id}","starred_url":"https://api.github.com/users/swarnenduDutta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swarnenduDutta/subscriptions","organizations_url":"https://api.github.com/users/swarnenduDutta/orgs","repos_url":"https://api.github.com/users/swarnenduDutta/repos","events_url":"https://api.github.com/users/swarnenduDutta/events{/privacy}","received_events_url":"https://api.github.com/users/swarnenduDutta/received_events","type":"User","site_admin":false},"created_at":"2018-09-12T12:02:57Z","updated_at":"2018-09-12T12:02:57Z","author_association":"NONE","body":"Hi @escopecz \r\n\r\nThanks for the fix and really appreciate you working on open source marketing automation. :+1: \r\n\r\nI tested this out. Well this works as you said.\r\n\r\n2 things : \r\n\r\n1. When I clone an item, the cloned item populates the values but few fields are disabled to change. Is that required behaviour ? What if one item needs to change ?\r\n\r\n![screenshot_2018-09-12 edit custom field - age mautic](https://user-images.githubusercontent.com/6310194/45423638-9203f680-b6b1-11e8-92aa-dc201e5ae1dd.png)\r\n\r\n\r\n\r\n2. When I dont save the cloned item and cancel, the cloned item still shows up on the list unpublished.\r\n\r\n![screenshot_2018-09-12 custom fields mautic](https://user-images.githubusercontent.com/6310194/45423646-96c8aa80-b6b1-11e8-8f2f-b19d13e74c1a.png)\r\n\r\nPlease let me know what you think on these. Also this is my first activity on Mautic and would love to contribute as much as I can.\r\n\r\nThanks\r\n\r\n"}}
{"actor":{"display_login":"swarnenduDutta"}}