Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    Nov 2013
    Location
    China
    Posts
    75
    Plugin Contributions
    0

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

  2. #2
    Join Date
    Nov 2013
    Location
    China
    Posts
    75
    Plugin Contributions
    0

    Default Re: Bad Request was received while processing an ajax call. The action you requested

    Name:  20161223002301.jpg
Views: 1448
Size:  9.8 KB
    Here is a screenshot

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,402
    Plugin Contributions
    94

    Default Re: Bad Request was received while processing an ajax call. The action you requested

    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.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

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

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Nov 2013
    Location
    China
    Posts
    75
    Plugin Contributions
    0

    Default 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 Code:
    <?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("&amp;", unescape("&amp;"));
      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_CARTFILENAME_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 
    }?>

  6. #6
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

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

    Quote Originally Posted by e-standard View Post
    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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Dec 2016
    Location
    Washington
    Posts
    106
    Plugin Contributions
    0

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

    Quote Originally Posted by DrByte View Post
    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

  8. #8
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

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

    Quote Originally Posted by answer=42 View Post
    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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Dec 2016
    Location
    Washington
    Posts
    106
    Plugin Contributions
    0

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

    Quote Originally Posted by mc12345678 View Post
    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.

  10. #10
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,475
    Plugin Contributions
    11

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

    Quote Originally Posted by answer=42 View Post
    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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. An unknown response null::text/html ::FORBIDDEN was received
    By roxannepercy in forum General Questions
    Replies: 7
    Last Post: 1 Aug 2016, 05:53 AM
  2. v155 An unknown response null::text/html ::SYNTAXERROR: was received while
    By K_C_Enterprises in forum General Questions
    Replies: 5
    Last Post: 28 May 2016, 09:02 PM
  3. Replies: 7
    Last Post: 4 May 2016, 01:59 AM
  4. v154 An unknown response null::text/html; charset=iso-8859-1::
    By bearlymakinit in forum Basic Configuration
    Replies: 7
    Last Post: 28 Aug 2015, 05:33 PM
  5. Replies: 16
    Last Post: 20 Feb 2015, 10:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR