At the the bottom of the Public Library page there are two buttons: one to download all missing extensions, and one to update all extensions that are out of date. The titles of these, and the list of extensions to download, are not correct after one or more extensions is downloaded.
The problem lies in the Javascript in the Public Library web page at http://emshort.com/pl/. In the script there are two arrays, containing the downloads to be done (window.getAllList and window.updateList) plus two integer variables giving their lengths (window.getAllLength and window.updateListLength). Items are added to these arrays, but never removed, and nor are the arrays reset.
When an extension is downloaded the front-end calls downloadSucceeded(), which in turn calls resetCounts(). This contains a long set of calls to query(), one for each extension, that adds to the above arrays if an extension is missing or out of date. The trouble is that these arrays should be reset before the calls to query(), otherwise extensions get counted twice or more.
Testing locally, a sufficient fix is to add this code just before all the calls to query():
Reported by : DavidK
Description :
At the the bottom of the Public Library page there are two buttons: one to download all missing extensions, and one to update all extensions that are out of date. The titles of these, and the list of extensions to download, are not correct after one or more extensions is downloaded.
The problem lies in the Javascript in the Public Library web page at http://emshort.com/pl/. In the script there are two arrays, containing the downloads to be done (window.getAllList and window.updateList) plus two integer variables giving their lengths (window.getAllLength and window.updateListLength). Items are added to these arrays, but never removed, and nor are the arrays reset.
When an extension is downloaded the front-end calls downloadSucceeded(), which in turn calls resetCounts(). This contains a long set of calls to query(), one for each extension, that adds to the above arrays if an extension is missing or out of date. The trouble is that these arrays should be reset before the calls to query(), otherwise extensions get counted twice or more.
Testing locally, a sufficient fix is to add this code just before all the calls to query():
window.getAllList = [];
window.getAllLength = 0;
window.updateList = [];
window.updateListLength = 0;
Steps to reproduce :
Additional information :
imported from: [Mantis 1947] Public Library page doesn't correctly update download buttons at the bottom after downloading extensions