Skip to content

Insert pll_ajax_backend parameter in a new empty object#824

Merged
Chouby merged 1 commit into
masterfrom
fix-14681-HS-ticket
Apr 14, 2021
Merged

Insert pll_ajax_backend parameter in a new empty object#824
Chouby merged 1 commit into
masterfrom
fix-14681-HS-ticket

Conversation

@manooweb
Copy link
Copy Markdown
Contributor

This PR fixes the HS #14681 ticket (private)

options.data could be undefined when it come from jQuery Form plugin espacially when it is used to upload a file because processData is set to false and data to null

So we need to insert pll_ajax_backend parameter in a new empty object instead to avoid the javascript error which blocks the uploading process.

Note that by jQuery Form plugin implementation the pll_ajax_backend parameter will be never sent to the server

So we need to insert pll_ajax_backend parameter in a new empty object instead
@manooweb manooweb added the bug label Apr 13, 2021
@manooweb manooweb added this to the 3.0.x milestone Apr 13, 2021
@raaaahman raaaahman self-requested a review April 13, 2021 11:52
@Chouby Chouby merged commit c3e330a into master Apr 14, 2021
@Chouby Chouby deleted the fix-14681-HS-ticket branch April 14, 2021 13:50
@Chrystll
Copy link
Copy Markdown

Chrystll commented Apr 23, 2021

There is no regression with the fix that we done in the 3.0.3 "Fix an ajax conflict with WooCommerce Tree Table Rate Shipping and HubSpot All-In-One Marketing" #803. It doesn't break the registration and the connection with the hubspot plugin.
As a reminder here is how to test Hubspot:

  1. create an account on https://www.hubspot.fr/
  2. go to Dashboard > Plugins > activated Polylang and HubSpot All-In-One Marketing - Forms, Popups, Live Chat
  3. go to Dashboard > Hubspot > User guide > select your account > click on "Continue with this account" > you get "Your website is now connected to hubspot" as shown below
    screenshot-trunk-test com-2021 04 23-09_16_30 (1)
    and no more a 400 bad request in the console as shown here:
    111620065-8ba4e700-87e6-11eb-888f-fe749668bf72

As a reminder here is how to test WooCommerce Tree Table Rate Shipping: (ticket HS)

  1. go to Dashboard > Plugins > activated Polylang and WooCommerce Tree Table Rate Shipping
  2. go to Dashboard > WooCommerce > Settings > Shipping tab > Tree Table rate > click on "Start from scratch", then "Add rule" > "Save changes".
  3. check the console > the added 'pll_ajax_backend=1' no longer prevent WooCommerce Tree Table Rate Shipping from working.

This PR fixes as expected the issue reported on HS #14681 ticket (private) with the FS License Manager (version 4.3.5). As a reminder here are the steps:

  1. go to Dashboard > Plugins > activated Polylang, Polylang for WooCommerce, WooCommerce and FS License Manager.

  2. go to Dashboard > License manager > Import > Import Image License Keys From .zip File > upload a .zip file containing an image.
    screenshot-trunk-test com-2021 04 26-11_08_59

  3. check the console > you shouldn't no longer get the error below:
    Capture du 2021-04-26 11-11-51

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants