Zen Cart Logo
Forums / General Questions / An unknown response null: :text/html; charset=utf-8: :Bad Request was received

An unknown response null: :text/html; charset=utf-8: :Bad Request was received

Views: 5,026

Results 1 to 19 of 19
22 Dec 2016, 3:59 PM
#1
e_standard avatar

e_standard

New Zenner

Join Date:
Nov 2013
Location:
China
Posts:
75
Plugin Contributions:
0

An unknown response null: :text/html; charset=utf-8: :Bad Request was received

An unknown response null: :text/html; charset=utf-8: :Bad Request was received while processing an ajax call. The action you requested could not be completed

I am desperate,when visitor login and click checkout or go to shopping cart,it will pop-up this message,someone please help,i don't know what's going on,thanks.:no:

22 Dec 2016, 4:24 PM
#2
e_standard avatar

e_standard

New Zenner

Join Date:
Nov 2013
Location:
China
Posts:
75
Plugin Contributions:
0

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

Attachment 16848
Here is a screenshot

22 Dec 2016, 5:27 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,091
Plugin Contributions:
56

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

You haven't identified the version of Zen Cart that you're running or which plugins you've installed, including shipping/payment methods (see the Posting Tips). If you give us a little more information, we'll be better able to help.

22 Dec 2016, 5:35 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

Common causes of that error are mismatched files for different ZC versions, particularly with templates built for v1.5.4 being used on v1.5.5 and not fully upgraded.

So in addition to your ZC version and all your plugins, please also list what template you're using and everything you've changed related to javascript files.

A URL would be the most helpful.

23 Dec 2016, 12:13 AM
#5
e_standard avatar

e_standard

New Zenner

Join Date:
Nov 2013
Location:
China
Posts:
75
Plugin Contributions:
0

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

I have found the problem,i am using a westminster_new template,there is a jscript_framework.php in jscript folder,after i delete,the problem won't be there,i am wondering what's going on with this file.

<?php
/**
 * @package admin
 * @copyright Copyright 2003-2014 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version GIT: $Id: Author: Ian Wilson  New in v1.5.4 $
 */
?>
<script type="text/javascript">
if (typeof zcJS == "undefined" || !zcJS) {
  window.zcJS = { name: 'zcJS', version: '0.1.0.0' };
};

zcJS.ajax = function (options) {
  options.url = options.url.replace("&", unescape("&"));
  var deferred = $.Deferred(function (d) {
      var securityToken = '<?php echo $_SESSION['securityToken']; ?>';
      var defaults = {
          cache: false,
          type: 'POST',
          traditional: true,
          dataType: 'json',
          timeout: 5000,
          data: $.extend(true,{
            securityToken: securityToken
        }, options.data)
      },
      settings = $.extend(true, {}, defaults, options);

      d.done(settings.success);
      d.fail(settings.error);
      d.done(settings.complete);
      var jqXHRSettings = $.extend(true, {}, settings, {
          success: function (response, textStatus, jqXHR) {
            d.resolve(response, textStatus, jqXHR);
          },
          error: function (jqXHR, textStatus, errorThrown) {
              console.log(jqXHR);
              d.reject(jqXHR, textStatus, errorThrown);
          },
          complete: d.resolve
      });
      $.ajax(jqXHRSettings);
   }).fail(function(jqXHR, textStatus, errorThrown) {
   var response = jqXHR.getResponseHeader('status');
   var responseHtml = jqXHR.responseText;
   var contentType = jqXHR.getResponseHeader("content-type");
   switch (response)
     {
       case '403 Forbidden':
         var jsonResponse = JSON.parse(jqXHR.responseText);
         var errorType = jsonResponse.errorType;
         switch (errorType)
         {
           case 'ADMIN_BLOCK_WARNING':
           break;
           case 'AUTH_ERROR':
           break;
           case 'SECURITY_TOKEN':
           break;

           default:
             alert('An Internal Error of type '+errorType+' was received while processing an ajax call. The action you requested could not be completed.');
         }
       break;
       default:
        if (jqXHR.status === 200 * contentType.toLowerCase().indexOf("text/html") >= 0) {
         document.open();
         document.write(responseHtml);
         document.close();
         } else {
           alert('An unknown response '+response+': :'+contentType+': :'+errorThrown+' was received while processing an ajax call. The action you requested could not be completed.');
         }
     }
   });

  var promise = deferred.promise();
  return promise;
};
zcJS.timer = function (options) {
  var defaults = {
    interval: 10000,
    startEvent: null,
    intervalEvent: null,
    stopEvent: null

},
  settings = $.extend(true, {}, defaults, options);

  var enabled = new Boolean(false);
  var timerId = 0;
  var mySelf;
  this.Start = function()
  {
      this.enabled = new Boolean(true);

      mySelf = this;
      mySelf.settings = settings;
      if (mySelf.enabled)
      {
          mySelf.timerId = setInterval(
          function()
          {
              if (mySelf.settings.intervalEvent)
              {
                mySelf.settings.intervalEvent(mySelf);
              }
          }, mySelf.settings.interval);
          if (mySelf.settings.startEvent)
          {
            mySelf.settings.startEvent(mySelf);
          }
      }
  };
  this.Stop = function()
  {
    mySelf.enabled = new Boolean(false);
    clearInterval(mySelf.timerId);
    if (mySelf.settings.stopEvent)
    {
      mySelf.settings.stopEvent(mySelf);
    }
  };
};
<?php if (isset($_SESSION['jscript_enabled'])) { ?>
<?php unset($_SESSION['jscript_enabled']); ?>
<?php } ?>
<?php if (PADSS_AJAX_CHECKOUT=='1' && in_array($current_page, array(FILENAME_CHECKOUT_CONFIRMATION,FILENAME_CHECKOUT_PAYMENT,FILENAME_CHECKOUT_SHIPPING,FILENAME_SHOPPING_CART, FILENAME_LOGIN))) { ?>
zcJS.ajax({
    url: "ajax.php?act=ajaxPayment&method=setNoscriptCookie",
    data: {test: '1'},
    async: false
  }).done(function( response ) {

  });
<?php } ?>
</script>
<?php if (PADSS_AJAX_CHECKOUT=='1' && ($current_page == FILENAME_CHECKOUT_CONFIRMATION || $current_page == FILENAME_CHECKOUT_PAYMENT || $current_page == FILENAME_CHECKOUT_SHIPPING) && !isset($_SESSION['jscript_enabled'])) { ?>
<?php if ($payment_modules->doesCollectsCardDataOnsite == true) { ?>
<noscript>
<meta http-equiv="refresh" content="0;url=<?php echo zen_href_link(FILENAME_SHOPPING_CART, 'jscript=no');?>">
</noscript>
<?php }?>
<?php }?>
23 Dec 2016, 4:15 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

e-standard:

I have found the problem,i am using a westminster_new template,there is a jscript_framework.php in jscript folder
Yes, that's your problem.
If you want to use that template on v1.5.5 you will need the v1.5.5 version of the jscript_framework.php file.

6 Jan 2017, 5:11 PM
#7
answer_42 avatar

answer_42

Zen Follower

Join Date:
Dec 2016
Location:
Washington
Posts:
109
Plugin Contributions:
0

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

DrByte:

Yes, that's your problem.
If you want to use that template on v1.5.5 you will need the v1.5.5 version of the jscript_framework.php file.
Due to PayPal “deleting the comma issue”, I had to upgrade from PayPal Standard to PayPal Express. After the upgrade, I received the (35) handshake failure error, which required an upgrade of Zen cart to fix.
I upgraded Zen cart from v1.5.1 to v1.5.5d and this caused “An unknown response null: :text/html; charset=utf-8: :Bad Request was received while processing an ajax call. The action you requested could not be completed” error.
Following your advice, I changed /includes/templates/MY_TEMPLATE/jscript/jscript_framework.php file by copying the one from /includes/template_default/jscript/jscript_framework.php in v155, it worked perfectly and I no longer get the pop up, Thank You.
Is that the only error that you know of from upgrading?
I am using Winchester responsive template and I still need to install Ceon Advanced Shipper 5.0.2 and Ceon URI Map 4.5.1

6 Jan 2017, 5:48 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

answer=42:

Due to PayPal “deleting the comma issue”, I had to upgrade from PayPal Standard to PayPal Express. After the upgrade, I received the (35) handshake failure error, which required an upgrade of Zen cart to fix.
I upgraded Zen cart from v1.5.1 to v1.5.5d and this caused “An unknown response null: :text/html; charset=utf-8: :Bad Request was received while processing an ajax call. The action you requested could not be completed” error.
Following your advice, I changed /includes/templates/MY_TEMPLATE/jscript/jscript_framework.php file by copying the one from /includes/template_default/jscript/jscript_framework.php in v155, it worked perfectly and I no longer get the pop up, Thank You.
Is that the only error that you know of from upgrading?
I am using Winchester responsive template and I still need to install Ceon Advanced Shipper 5.0.2 and Ceon URI Map 4.5.1
Check your logs folder for any additional errors generated and actually, the error was generated "by upgrading", but by not maintaining the involved software compatible with the current in use version of ZC. There are likely/possibly other actions necessary to further make the responsive template compatible, but that is an issue to address/discover within the thread for the particular software.

6 Jan 2017, 6:45 PM
#9
answer_42 avatar

answer_42

Zen Follower

Join Date:
Dec 2016
Location:
Washington
Posts:
109
Plugin Contributions:
0

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

mc12345678:

Check your logs folder for any additional errors generated and actually, the error was generated "by upgrading", but by not maintaining the involved software compatible with the current in use version of ZC. There are likely/possibly other actions necessary to further make the responsive template compatible, but that is an issue to address/discover within the thread for the particular software.
Thank you.
After checking logs there was an error; PHP Warning: constant(): Couldn't find constant includes/functions/admin_access.php on line 38
time for some research.

6 Jan 2017, 6:55 PM
#10
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,799
Plugin Contributions:
15

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

answer=42:

Thank you.
After checking logs there was an error; PHP Warning: constant(): Couldn't find constant includes/functions/admin_access.php on line 38
time for some research.That should have been fixed in 1.5.3. Might want to check the files and make sure you've got the current version AND take a look at this thread.

6 Jan 2017, 7:02 PM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

Considering that were performing an upgrade from 1.5.1 to 1.5.5, it would appear that the error occurred before the equivalent/applicable 1.5.5 file(s) were in place as the line containing the constant() function moved from 38 (zc 1.5.1) to 39 (as found in 1.5.5). If the error is not recent or reproducible in some consistent way, then it may have been involved with/related to the upgrade process.

All that said, if there are still issues and then are not related to the original topic of this thread, perhaps a new thread should be begun.

6 Jan 2017, 11:23 PM
#12
answer_42 avatar

answer_42

Zen Follower

Join Date:
Dec 2016
Location:
Washington
Posts:
109
Plugin Contributions:
0

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

dbltoe:

That should have been fixed in 1.5.3. Might want to check the files and make sure you've got the current version AND take a look at this thread.

There is nothing in the logs past the time when I did the upgrade, any idea what I can do to try to trigger it again?

6 Jan 2017, 11:34 PM
#13
answer_42 avatar

answer_42

Zen Follower

Join Date:
Dec 2016
Location:
Washington
Posts:
109
Plugin Contributions:
0

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

mc12345678:

Considering that were performing an upgrade from 1.5.1 to 1.5.5, it would appear that the error occurred before the equivalent/applicable 1.5.5 file(s) were in place as the line containing the constant() function moved from 38 (zc 1.5.1) to 39 (as found in 1.5.5). If the error is not recent or reproducible in some consistent way, then it may have been involved with/related to the upgrade process.

All that said, if there are still issues and then are not related to the original topic of this thread, perhaps a new thread should be begun.
I apologize that I didn't see your post, you are correct. The topic of the thread was solved.

11 Jan 2017, 5:02 PM
#14
pepeyotl avatar

pepeyotl

New Zenner

Join Date:
Jun 2012
Posts:
1
Plugin Contributions:
0

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

el problema esta resuelto
uso el tema Winchester Black y en /includes/templates/winchester_black/jscript/jscript_framework.php solo se debe eliminar lo siguiente: yo lo encontre en las lineas 71 a 73 solo en la linea 71 se deja el corchete de cierre
else {
alert('An unknown response '+response+': :'+contentType+': :'+errorThrown+' was received while processing an ajax call. The action you requested could not be completed.');
}

se guarda el docimento y listo se termina con ese error tan desagradable
espero sea de apoyo
*** no se escribir en ingles sorry

7 Mar 2017, 7:11 AM
#15
pbsnow2000 avatar

pbsnow2000

New Zenner

Join Date:
Aug 2013
Location:
California
Posts:
2
Plugin Contributions:
0

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

Im having the same problem. I'm presently using Zen Cart (v1.5.5d), With Picaflour-Azul Westminster New. When I add an item to the cart, I get: An unknown response null: :text/html; charset=utf-8: :Bad Request was received while processing an ajax call. The action you requested could not be completed. The location of the site im working on is: http://beautifulhairbeautifulu.com/index.php?main_page=product_info&cPath=1&products_id=3. I'm fairly new to zen cart and to this forum. Someone, please help!

7 Mar 2017, 12:00 PM
#16
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,091
Plugin Contributions:
56

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

As mentioned by DrByte in post #6 of this thread, that picaflor-azul template contains a down-level version of the file /includes/templates/westminster_new/jscript/jscript_framework.php.

You can either remove that file entirely (in which case the "correct" version of the file in /includes/templates/template_default/jscript/jscript_framework.php will be used automatically) or replace the file in your template directory with that "correct" version.

8 Mar 2017, 6:19 PM
#17
pbsnow2000 avatar

pbsnow2000

New Zenner

Join Date:
Aug 2013
Location:
California
Posts:
2
Plugin Contributions:
0

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

pbsnow2000:

Im having the same problem. I'm presently using Zen Cart (v1.5.5d), With Picaflour-Azul Westminster New. When I add an item to the cart, I get: An unknown response null: :text/html; charset=utf-8: :Bad Request was received while processing an ajax call. The action you requested could not be completed. The location of the site im working on is: http://beautifulhairbeautifulu.com/index.php?main_page=product_info&cPath=1&products_id=3. I'm fairly new to zen cart and to this forum. Someone, please help!

Thank you so much, that fixed the problem...

13 Sep 2017, 7:44 PM
#18
thunder2010 avatar

thunder2010

New Zenner

Join Date:
Aug 2010
Location:
Egypt - USA
Posts:
86
Plugin Contributions:
0

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

lat9:

As mentioned by DrByte in post #6 of this thread, that picaflor-azul template contains a down-level version of the file /includes/templates/westminster_new/jscript/jscript_framework.php.

You can either remove that file entirely (in which case the "correct" version of the file in /includes/templates/template_default/jscript/jscript_framework.php will be used automatically) or replace the file in your template directory with that "correct" version.

This is the correct solution.

Thank you

1 Aug 2019, 11:36 PM
#19
sports_guy avatar

sports_guy

Totally Zenned

Join Date:
Apr 2007
Location:
Dayton, Ohio
Posts:
682
Plugin Contributions:
0

Re: An unknown response null: :text/html; charset=utf-8: :Bad Request was received

e-standard:

I have found the problem,i am using a westminster_new template,there is a jscript_framework.php in jscript folder
I just upgraded from ZenCart v1.5.5a to v1.6c and am also using Wesminster and also have the same error code on my shopping cart page. I followed their upgrade instructions to a tee, yet this issue still popped-up.

I noticed this file (/public_html/includes/templates/westminster_new/jscript/jscript_framework.php) was not present in the new version of Wesminster (v2.0) therefore this file removal should have been listed in their upgrade instructions. Must have been overlooked. Just rename or remove this file to get it working like previous version solution.