Fix synchronous loaded scripts #6749

Merged
merged 1 commit into from Nov 7, 2016

Projects

None yet
@Shudrum
Member
Shudrum commented Oct 21, 2016 edited
Questions Answers
Branch? 1.6.1.x
Description? Synchronous calls are deprecated, this PR is about remove all of them.
Type? bug fix
Category? BO
BC breaks? ???
Deprecations? ???
Fixed ticket? http://forge.prestashop.com/browse/PSCSX-8524
@Shudrum Shudrum added the WIP label Oct 21, 2016
@Shudrum Shudrum added this to the 1.6.1.8 milestone Oct 21, 2016
@maximebiloe maximebiloe modified the milestone: 1.6.1.9, 1.6.1.8 Oct 25, 2016
@hadjedjvincent
Contributor

Planned for 1.6.1.9, really ?

@Shudrum Shudrum added waiting for QA feedback and removed WIP labels Oct 25, 2016
@Shudrum
Member
Shudrum commented Oct 25, 2016

Our 1.6.1.8 process is running …

But it does not mean it one month. It will be available as soon as the fix is correctly tested. Also, we will provide more informations for people who don't want to upgrade their shops and apply the fix manually.

@Shudrum
Member
Shudrum commented Oct 25, 2016 edited

And if the fix is ok before the 1.6.1.8, we will integrate the fix into it, of course.

@Shudrum
Member
Shudrum commented Oct 25, 2016

Last update thanks to @firstred!

Many many many thanks for the time and effort!

@themella
themella commented Oct 28, 2016 edited

I made fix in two different 1.6.1.6 prestashop and in one of them bug is fixed in the second one now you are not able to save modification or new products cause you press "save" and "save and stay" button but nothing will happend.

I checked file by file and fix was applied correctly.

@AntoInta

Hello everybody,
before applying this fix I realized that in Google Chrome v. 53.x.x.x the problem raised by @themella (nothing happens after clicking on "Save" or "Save and Stay")
is not present, but after the update to Chrome v. 54.x.x.x it comes out!

Hope this could be useful.

Thanks to everybody for your efforts

@Ledfanatic

Hello,

Thank you for your work :)
On prestashop 1.6.1.4, tested with google 53 and 54 if I made all fixes, I can't "save" nor "save and stay" on the product page.
But if I don't apply the first modification on form.tpl, those are working correctly ....

And no more warning "Synchronous calls are deprecated" on the console.

Waiting confirmation that I am not the only one to have that.

Thanks !!

@firstred
Contributor

No, that's not correct. It will still send only half of the form in some cases. The reason why not removing the stuff in form.tpl works for you is because the e.preventDefault(); is still in the PR (this prevents the form from submitting). That is the one that should be removed.

@Ledfanatic

Ok, I understand. Thank you for the tip.

@dave-ps
Contributor
dave-ps commented Nov 1, 2016

this seems to have fixed 1.6.1.5, customer signed off, will check more as i get support tickets on them.

@dave-ps
Contributor
dave-ps commented Nov 2, 2016

1.6.1.6 fixed with these edits. Customer's problem went away.

@Ledfanatic

On prestashop 1.6.1.4 when you add a picture you still have the "jquery-1.11.0.min.js:4 Synchronous XMLHttpRequest on the main thread is deprecated ".
Thanks

@themella
themella commented Nov 3, 2016

I made a lot of test and I can confirm : FIX DON'T WORK for 1.6.1.6 and 1.6.1.5 cause when you change all 9 files button doesn't work at all.

So solution isn't applicable and all my customer still have chrome problem.

there is any news about fixing this really bad bug? actually bug isn't fixed.

@Ledfanatic
Ledfanatic commented Nov 3, 2016 edited

I am on 1.6.1.4 and the button works fine with latest Google Chrome release. I only have sometimes the "jquery-1.11.0.min.js:4 Synchronous XMLHttpRequest on the main thread is deprecated " and immediately after lot of errors JS and dnd then a deconnection from my back office.
Error after Synchronous deprecated are 👍

products.js:903 Uncaught TypeError: $(...).chosen is not a function(…)success @ products.js:903j @ jquery-1.11.0.min.js:2fireWith @ jquery-1.11.0.min.js:2x @ jquery-1.11.0.min.js:4b @ jquery-1.11.0.min.js:4
jquery.tablednd.js:149 Uncaught TypeError: Cannot read property 'dragObject' of undefined(…)mousemove @ jquery.tablednd.js:149dispatch @ jquery-1.11.0.min.js:3r.handle @ jquery-1.11.0.min.js:3
jquery.tablednd.js:249 Uncaught TypeError: Cannot read property 'currentTable' of undefined(…)mouseup @ jquery.tablednd.js:249dispatch @ jquery-1.11.0.min.js:3r.handle @ jquery-1.11.0.min.js:3
jquery.tablednd.js:149 Uncaught TypeError: Cannot read property 'dragObject' of undefined(…)
@themella
themella commented Nov 3, 2016 edited

@Ledfanatic

with pc or mac Platform?

I found with pc platform button will die with mac button will survive and work fine.

@Ledfanatic

I am on PC platform. Windows 8.1. Chrome 54.0.2840.71 m (64-bit)

@themella
themella commented Nov 3, 2016 edited

@Ledfanatic
@Shudrum

I found problem with windows 10 anche chrome 54.0.2840.87 m (64bit) lastest one.

@Ledfanatic

I just upgraded to Chrome 54.0.2840.87 m (64bit) and button works fine too...

@themella
themella commented Nov 3, 2016

@Ledfanatic
@Shudrum

I can't understand why in some pc works and other not work.

@katenagel

I am using 1.6.1.4 and my file is different than the one shown. How do I find the correct line?

@Ledfanatic
Ledfanatic commented Nov 3, 2016 edited

@themella
@Shudrum

After more tests I encountered a problem. the Save and stay button works (modification saved) but the save button didn't save any more !!
Not always in fact. sometimes yes, sometimes no I have difficulties to reproduce each time the same result, sorry

@themella
themella commented Nov 3, 2016 edited

@themella
@Shudrum

After million of test i found the key.
Chrome don't update correcly js file.

You need to open in new panel trought developer source panel any js file to be sure are updated.

after that fix seems work correctly. Tested on 1.6.1.5 tomorrow i will test on other version.

@carvisionuk

This is a very strange one to be fair!!
i've updated all files, and mods, and now can save in Google Chrome (54) and also Firefox (never experienced an issue here anyways) Microsoft Edge,

As before i had no way to save or change product descriptions, until i did the mods, now i can make between two or three changes, before it stops updating again, Both Chrome and Edge, but Firefox still updates regardless,

i'm running 1.6.1.8

Can i try anything else? been trying to fix this for sometime now and slowly loosing the will to live!! lol.

@dave-ps
Contributor
dave-ps commented Nov 4, 2016

Did you clear your web browser cache? Did you set smarty to recompile if
changes? You have to do both
On Nov 3, 2016 11:12 AM, "Roberto Bottazzi" notifications@github.com
wrote:

@Ledfanatic https://github.com/Ledfanatic
@Shudrum https://github.com/Shudrum

I can't understand why in some pc works and other not work.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#6749 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABz61ar_o_RASy2-CFc8aNxjmo6DxpzZks5q6fmqgaJpZM4KdU53
.

@carvisionuk
carvisionuk commented Nov 4, 2016 edited

Hi David,
Thank you for your reply,
Yes I cleared the Web Browser on my PC and also cleared Smarty in BO

From: David Eschmeyer [mailto:notifications@github.com]
Sent: 04 November 2016 19:35
To: PrestaShop/PrestaShop PrestaShop@noreply.github.com
Cc: Car Vision UK john@car-vision.co.uk; Comment comment@noreply.github.com
Subject: Re: [PrestaShop/PrestaShop] Fix synchronous loaded scripts (#6749)

Did you clear your web browser cache? Did you set smarty to recompile if
changes? You have to do both

@carvisionuk

Do you know if all modified files are in 1.6.1.9?

@Ledfanatic

@dave-IP

Web browser cleared and "smarty recompile if changes" OK.
After some days it seems better for the moment no more Synchronous deprecated when save or stay and save.

I still get the synchronous message deprecated when I upload new pictures for a product, just after I click on the "upload files" button ? catalog>products>images>add files>upload files

Any of you with the same error ? Thank you.

@gskema
Contributor
gskema commented Nov 7, 2016 edited

I can confirm that this isn't working on Chrome Version 55.0.2883.28 beta (64-bit) either.

@gskema
Contributor
gskema commented Nov 7, 2016 edited

@Shudrum Does this replace all of the sync ajax calls? My search found a total of 37 async: false code occurrences.

@Shudrum Shudrum merged commit 0461930 into PrestaShop:1.6.1.x Nov 7, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Shudrum
Member
Shudrum commented Nov 7, 2016

@gskema Yep, we fix the product page first.

@cdbruin
cdbruin commented Nov 7, 2016

I tested it on 1.6.1.3 and unfortunately now my buttons are spinning with the following error:
Uncaught TypeError: $(...).typeahead is not a function(…)

@firstred
Contributor
firstred commented Nov 7, 2016

Does it help if you wrap it in a $(document).ready() ?

@cdbruin
cdbruin commented Nov 7, 2016

No unfortunately it does not help.

@xBorderie
Member

We have released 1.6.1.9 with this fix: http://build.prestashop.com/news/prestashop-1619-maintenance-release/
Thank you for your help testing it, everyone!

@cdbruin
cdbruin commented Nov 8, 2016

I use version 1.6.3 on my production server and can't just upgrade.
Somehow this fix does not work on my multistore server.
I have reverted back to chrome 53 and that seems to fix it also.
Somehow the typeahead script is not run or not run in time.
keep getting the Uncaught TypeError: $(...).typeahead is not a function(…)

@Mimiwool
Mimiwool commented Nov 9, 2016

Bonjour,

Pouvez-vous m'expliquer comment puis je installer le patch ci dessous fournit par prestashop ?
https://github.com/PrestaShop/PrestaShop/pull/6749/files#diff-5336fdb784fed5a634ff94fd946cf644

C'est pour régler le soucis de l'enregistrement des produits qui mouline sans arrêt.
Merci d'avance

@Ledfanatic

Bonjour,

Il faut modifier chacun des fichiers de votre installation prestashop indiqués dans le lien. Soit 9 fichiers a éditer, modifier et uploader par FTP dans les chemins indiqués..
Conseil, sauvegardez les versions originales avant d'envoyer les versions modifiées, une erreur est si vite arrivée.

@tomgug
tomgug commented Nov 10, 2016

Unfortunately on my ps not works....

@firstred
Contributor

Unfortunately on my ps not works....

Do you have some more info, with which we can figure out why it doesn't work on your instance of PrestaShop?

@tomgug
tomgug commented Nov 10, 2016

I modified all files, deleted cache on ps, deleted cache on browser but when I open a product load infinitely.
I've same error described on this topic:
https://www.prestashop.com/forums/topic/451384-unresponsive-script-at-backoffice-product/

thanks

@firstred
Contributor

Have you checked if you applied the modifications correctly?

Some of the modifications set a timeout and reset it when the needed libraries (tinymce, typeahead) aren't there. This should stop once the libraries are loaded.

Do you see any errors when you open up Chrome's Developer Tools?

@tomgug
tomgug commented Nov 10, 2016

this is the problem:
schermata 2016-11-11 alle 00 35 44

@firstred
Contributor
@RempadDesign

Hi, we have a problem after applying the patch to prestashop 1.6.1.0. All working good, but the subcategoryes are not loaded when try to add new product in the store: https://snag.gy/co2hwf.jpg

If we save the product and the page gets reloaded the subcategoryes will show, but it's anoying. I think this is a problem of ajax that is not loading dynamicaly the subcategoryes anymore...and they will show only after page refresh.

Thank you.

@serdib
serdib commented Nov 19, 2016

I have changed all 9 files, but it doesnt fix anything on Prestashop 1.6.1.2 (with Chrome_54.0.2840.99 on Windows_8)
Now when i open any product in BO i have many errors. See screen — http://imgur.com/yRIaQZK
And save buttons are spinning forever now.
What should i do? I cant just upgrade the whole shop to 1.6.1.9 because i have too many modified files.

P.S. in Internet Explorer 10 everithing works fine but it worked before this fix too.

440

@jorgevrgs
Contributor
jorgevrgs commented Nov 21, 2016 edited

Some features are still unavailable:

  • Update tracking number
  • Update product quantity
  • Change combinations
  • Push notifications to restart counter
  • Update price, visible on back office but don't change in front-office
@Uebix
Contributor
Uebix commented Dec 7, 2016

A fix to this PR: #7179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment