I believe the reason for this is that functions like unlock() in class_media_mover_file are currently testing whether they are on the last step by checking step_count(). This would work except that step_order seems to start at 0, so count != step number.

I've attached a patch for the solution I'm using at the moment, which was to add a last_step() function to class_media_mover_configuration, and changed instances of step_count() in class_media_mover_file.php to last_step()

An alternative solution would just be to modify the step_count() function, but I felt like that was not as clear as step_count() does return the correct value and may be useful elsewhere.

CommentFileSizeAuthor
last_step.patch2.01 KBcivicpixel

Comments

civicpixel’s picture

Status: Active » Needs review
arthurf’s picture

Committed and ready for testing

civicpixel’s picture

Status: Needs review » Fixed

Tested on our development and live servers for a week, marking as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.