Problem/Motivation
For some batch operations, it appears that there is a miscount on both the output when running by drush or seeing the completed status in the Batch operation UI
Processed item_11. [85%] [12/14]
Processed item_12. [92%] [13/14]
Process completed: Tried 14 out of 14 cron strings. See the log for debug and manual validation.
The item count says 12 but starts at 0 so it means 13. However the totals reported say 14. So it looks like a difference of 2 but is really only off by 1.
However others, the count is correct. Something seems flimsy here. Ought to adjust the item output to not start at 0 as well. It leads to confusion.
Steps to reproduce
- In the UI run TestDo10Things
- Look at the related log display. It will show the right completed count
- In the terminal run `drush codit-batch-operations:run TestDo10Things` It will show the right count in the log and the terminal.
- In the UI run TestAllCronTimeStrings
- Look at the related log display, notice the count is off.
- In the terminal run `drush codit-batch-operations:run TestAllCronTimeStrings` Notice the count in the terminal is off and so is the count in the status display
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
swirtComment #3
swirtComment #4
swirtThis was caused if an array of items to process has an index of 0. I altered to make sure anything with an index of 0 gets rekeyed to start at 1.
Comment #6
swirtComment #7
swirtReleased as 1.0.1-rc2