Jump to content

Recommended Posts

Posted

The progress bar for multiple image uploader accepts only integer values, otherwise it displays NaN instead of current progress and scale is always at 0%. But gallery upload script returns float value as current step. If you upload 4 pics, everything will be fine - 25%, 50%, 75%, 100%. But if you upload 3 pics: 33.3333% => NaN, 66.6666% => NaN, 100%.

To fix this I've changed a line it \applications\gallery\modules\front\gallery\submit.php line 877:

return array( ++$offset, \IPS\Member::loggedIn()->language()->addToStack('processing'), 100 / ( \IPS\Request::i()->totalImages ?: $offset ) * $offset );

To:

return array( ++$offset, \IPS\Member::loggedIn()->language()->addToStack('processing'), intval(100 / ( \IPS\Request::i()->totalImages ?: $offset ) * $offset) );

And now uploader shows correct progress for any number of pics.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...