{"action":"opened","issue":{"url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/issues/4803","repository_url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads","labels_url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/issues/4803/labels{/name}","comments_url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/issues/4803/comments","events_url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/issues/4803/events","html_url":"https://github.com/easydigitaldownloads/easy-digital-downloads/issues/4803","id":166214340,"number":4803,"title":"batch payments import - missing rows on import ","user":{"login":"selul","id":3330746,"avatar_url":"https://avatars.githubusercontent.com/u/3330746?v=3","gravatar_id":"","url":"https://api.github.com/users/selul","html_url":"https://github.com/selul","followers_url":"https://api.github.com/users/selul/followers","following_url":"https://api.github.com/users/selul/following{/other_user}","gists_url":"https://api.github.com/users/selul/gists{/gist_id}","starred_url":"https://api.github.com/users/selul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selul/subscriptions","organizations_url":"https://api.github.com/users/selul/orgs","repos_url":"https://api.github.com/users/selul/repos","events_url":"https://api.github.com/users/selul/events{/privacy}","received_events_url":"https://api.github.com/users/selul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-18T23:10:50Z","updated_at":"2016-07-18T23:10:50Z","closed_at":null,"body":"According to [this](https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/admin/import/class-batch-import-payments.php#L32) setting on each import step, it should save 5 payments, but if we follow the algorithm there are just 4 saved, missing one, the last one, at each iteration. \r\n\r\n[Here](https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/admin/import/class-batch-import-payments.php#L83) the default value is 1 and because the break loop condition is before the payment creation, [here] (https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/admin/import/class-batch-import-payments.php#L102) , the iteration will always be with +1 greater than the no. of payments imported. \r\n\r\nAlso [this] (https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/admin/import/class-batch-import-payments.php#L84) if/else statement is not needed because if the` $step` propriety is zero, `$this->per_step * ( $this->step - 1 )` will also return zero. \r\n\r\n\r\n"}}
{"actor":{"display_login":"selul"}}