# HG changeset patch # User Mario Ferraro # Date 1241825782 -7200 # Node ID fd14daa4b45a9f9422f77f916a4332873ea427d1 # Parent b9fd1e20d41302b68642fdafd477770edd0b402d Fixes Issue 625 where the Duplicate calculation would hang if no assigned slots where available. Reviewed by: Lennard de Rijk diff -r b9fd1e20d413 -r fd14daa4b45a app/soc/content/js/duplicate-slots-090331.js --- a/app/soc/content/js/duplicate-slots-090331.js Sat May 09 01:14:03 2009 +0200 +++ b/app/soc/content/js/duplicate-slots-090331.js Sat May 09 01:36:22 2009 +0200 @@ -11,13 +11,19 @@ this.showDuplicatesInit = function() { + html_string = ''; // Remember this object for Javascript scoping - html_string = ''; var this_object = this; var NUMBER_OF_ORGS = number_of_orgs; var OFFSET_LENGTH = offset_length; // Variables to handle progress bar updating var ITERATIONS = (number_of_orgs % offset_length)==0 ? Math.floor(number_of_orgs/offset_length) : Math.floor(number_of_orgs/offset_length)+1; + + if (ITERATIONS==0) { + $("#div_duplicate_slots").html("No org slots to process"); + return; + } + var successful_calls = 0; $("#id_button_duplicate_slots").fadeOut("slow",