elementor / static-html-output

Static HTML Output Plugin for WordPress
https://statichtmloutput.com
The Unlicense
124 stars 33 forks source link

Updating with 'folder' deployment option causes JS error #103

Closed crstauf closed 4 years ago

crstauf commented 4 years ago
Uncaught TypeError: Cannot read property 'replace' of undefined
    at updateBaseURLReferences (admin.php?page=statichtmloutput:739)
    at HTMLDocument.<anonymous> (admin.php?page=statichtmloutput:1222)
    at i (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.4.2:2)
    at Object.fireWith [as resolveWith] (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.4.2:2)
    at Function.ready (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.4.2:2)
    at HTMLDocument.J (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.4.2:2)

This JavaScript error I believe prevents the ~"Save current options" and "Reset to default settings" buttons from activating, and also doesn't show~ options for the default deployment option ("ZIP archive") from showing on page load.

By choosing a different deployment option, choosing "ZIP archive" again, the settings appear.

leonstafford commented 4 years ago

hmm, @thegulshankumar saw similar, I haven't been able to reproduce. Possible, that the folder deployment was saved in options before upgrade, then it's no longer there causing the issue

Can you try clearing manually the statichtml-options entry from WP's options table?

crstauf commented 4 years ago

@leonstafford Oooh that could be. I'll restore back to 6.6.17 and try that and see what happens.

crstauf commented 4 years ago

@leonstafford Confirmed... this issue occurs seems to occur only if "Folder" is the deployment option prior to upgrading to 6.6.19.

Test 1

  1. "Folder" deployment on 6.6.17
  2. Upgrade to 6.6.19
  3. Observed error

Test 2

  1. "ZIP archive" deployment on 6.6.17
  2. Upgrade to 6.6.19
  3. Did not observe error
leonstafford commented 4 years ago

Thanks @crstauf for confirming the bug!

Will add as part of the work around ensuring updates work

leonstafford commented 4 years ago

@crstauf @thegulshankumar have pushed up a quick fix for this, not elegant, but should work. will do more testing of whole update process before release