{"action":"opened","issue":{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/3395","labels_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/3395/labels{/name}","comments_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/3395/comments","events_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/3395/events","html_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/3395","id":75294428,"number":3395,"title":"Multiple tax rates with same id in taxes settings","user":{"login":"bseddon","id":1221824,"avatar_url":"https://avatars.githubusercontent.com/u/1221824?v=3","gravatar_id":"","url":"https://api.github.com/users/bseddon","html_url":"https://github.com/bseddon","followers_url":"https://api.github.com/users/bseddon/followers","following_url":"https://api.github.com/users/bseddon/following{/other_user}","gists_url":"https://api.github.com/users/bseddon/gists{/gist_id}","starred_url":"https://api.github.com/users/bseddon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bseddon/subscriptions","organizations_url":"https://api.github.com/users/bseddon/orgs","repos_url":"https://api.github.com/users/bseddon/repos","events_url":"https://api.github.com/users/bseddon/events{/privacy}","received_events_url":"https://api.github.com/users/bseddon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-11T17:20:46Z","updated_at":"2015-05-11T17:20:46Z","closed_at":null,"body":"Suppose I have have three tax rates.  In the table the fields are indexed by a number representing the respective row.  Suppose now I delete the row with index '2'.  After this action I have two rows with indexes '1' and '3'.\r\n\r\nNext suppose that I add a new rate.  The JavaScript code in admin-scripts.js responsible for adding the new row is the function that responds to the 'Add Tax Rate' button:\r\n\r\n`$('#edd_add_tax_rate').on('click', function() {...});`\r\n\r\nThis function determines the index to assign to the new row by counting the existing rows.  In the scenario above, the index of the new row will be '3' which is the same as the index of the last row.\r\n\r\nThis does not cause an instant failure but it does seem to mean the form data sent to the server will contain only values for the second of the rows with an index of '3' which I think explains why some times I lose rate settings.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1221824/7570742/58b01990-f80a-11e4-95e1-c4c35350610b.png)\r\n\r\n\r\n\r\n"}}