Skip to content

Commit

Permalink
Merge pull request #5750 from openfoodfacts/fileupload
Browse files Browse the repository at this point in the history
Do not load jquery.fileupload.js twice, fixes producers platform image upload bug
  • Loading branch information
stephanegigandet authored Sep 24, 2021
2 parents 4306c28 + 92b2102 commit 60811ec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ProductOpener/Images.pm
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,20 @@ sub display_search_image_form($) {
HTML
;

# Do not load jquery file upload twice, if it was loaded by another form

$scripts .= <<JS
if ($scripts !~ /jquery.fileupload.js/) {

$scripts .= <<JS
<script type="text/javascript" src="/js/dist/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="/js/dist/jquery.fileupload.js"></script>
<script type="text/javascript" src="/js/dist/load-image.all.min.js"></script>
<script type="text/javascript" src="/js/dist/canvas-to-blob.js"></script>
JS
;

}

$initjs .= <<JS
\/\/ start off canvas blocks for small screens
Expand Down

0 comments on commit 60811ec

Please sign in to comment.