New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix synchronous loaded scripts #6749

Merged
merged 1 commit into from Nov 7, 2016

Conversation

Projects
None yet
@Shudrum
Contributor

Shudrum commented Oct 21, 2016

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 milestones: 1.6.1.9, 1.6.1.8 Oct 25, 2016

@hadjedjvincent

This comment has been minimized.

Contributor

hadjedjvincent commented Oct 25, 2016

Planned for 1.6.1.9, really ?

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

@Shudrum

This comment has been minimized.

Contributor

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

This comment has been minimized.

Contributor

Shudrum commented Oct 25, 2016

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

@Shudrum

This comment has been minimized.

Contributor

Shudrum commented Oct 25, 2016

Last update thanks to @firstred!

Many many many thanks for the time and effort!

@themella

This comment has been minimized.

Contributor

themella commented Oct 28, 2016

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

This comment has been minimized.

Contributor

AntoInta commented Oct 28, 2016

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

This comment has been minimized.

Ledfanatic commented Oct 28, 2016

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

This comment has been minimized.

Contributor

firstred commented Oct 28, 2016

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

This comment has been minimized.

Ledfanatic commented Oct 28, 2016

Ok, I understand. Thank you for the tip.

@dave-ps

This comment has been minimized.

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

This comment has been minimized.

Contributor

dave-ps commented Nov 2, 2016

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

@Ledfanatic

This comment has been minimized.

Ledfanatic commented Nov 3, 2016

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

This comment has been minimized.

Contributor

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

This comment has been minimized.

Ledfanatic commented Nov 3, 2016

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

This comment has been minimized.

Contributor

themella commented Nov 3, 2016

@Ledfanatic

with pc or mac Platform?

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

@Ledfanatic

This comment has been minimized.

Ledfanatic commented Nov 3, 2016

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

@themella

This comment has been minimized.

Contributor

themella commented Nov 3, 2016

@Ledfanatic
@Shudrum

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

@Ledfanatic

This comment has been minimized.

Ledfanatic commented Nov 3, 2016

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

@themella

This comment has been minimized.

Contributor

themella commented Nov 3, 2016

@Ledfanatic
@Shudrum

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

@katenagel

This comment has been minimized.

katenagel commented Nov 3, 2016

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

@Ledfanatic

This comment has been minimized.

Ledfanatic commented Nov 3, 2016

@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

This comment has been minimized.

Contributor

themella commented Nov 3, 2016

@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.

@dave-ps

This comment has been minimized.

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

This comment has been minimized.

carvisionuk commented Nov 4, 2016

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

This comment has been minimized.

carvisionuk commented Nov 4, 2016

Do you know if all modified files are in 1.6.1.9?

@Ledfanatic

This comment has been minimized.

Ledfanatic commented Nov 6, 2016

@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

This comment has been minimized.

Contributor

gskema commented Nov 7, 2016

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

@gskema

This comment has been minimized.

Contributor

gskema commented Nov 7, 2016

@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

This comment has been minimized.

Contributor

Shudrum commented Nov 7, 2016

@gskema Yep, we fix the product page first.

@cdbruin

This comment has been minimized.

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

This comment has been minimized.

Contributor

firstred commented Nov 7, 2016

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

@cdbruin

This comment has been minimized.

cdbruin commented Nov 7, 2016

No unfortunately it does not help.

@xBorderie

This comment has been minimized.

Contributor

xBorderie commented Nov 8, 2016

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Ledfanatic commented Nov 9, 2016

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

This comment has been minimized.

tomgug commented Nov 10, 2016

Unfortunately on my ps not works....

@firstred

This comment has been minimized.

Contributor

firstred commented Nov 10, 2016

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

firstred commented Nov 10, 2016

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

This comment has been minimized.

tomgug commented Nov 10, 2016

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

@firstred

This comment has been minimized.

Contributor

firstred commented Nov 10, 2016

@RempadDesign

This comment has been minimized.

RempadDesign commented Nov 14, 2016

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

jorgevrgs commented Nov 21, 2016

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

This comment has been minimized.

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