Results 1 to 10 of 20

Hybrid View

  1. #1
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Notifier question

    Ohh, and sorry, the other changes of using __construct() and the substitution of $this for $zco_notifier and removal of the global $zco_notifier are all good changes that will allow the code to operate under PHP 7.0 as well as 5.3+...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #2
    Join Date
    Mar 2005
    Posts
    229
    Plugin Contributions
    0

    Default Re: Notifier question

    Thank you very much mc12345678, now I understand the new syntax.

    I've solved a lot of my problems as only one debug file is still there (I had several before), I'm still getting
    PHP Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /includes/classes/db/mysql/query_factory.php on line 115
    And the message is not very precise as I don't get who is calling...

    Let me check if all my files for Edit Orders are there...

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Notifier question

    Quote Originally Posted by hubert View Post
    Thank you very much mc12345678, now I understand the new syntax.

    I've solved a lot of my problems as only one debug file is still there (I had several before), I'm still getting


    And the message is not very precise as I don't get who is calling...

    Let me check if all my files for Edit Orders are there...
    Install the myDebug Backtrace plugin to get the highlighted information.

  4. #4
    Join Date
    Mar 2005
    Posts
    229
    Plugin Contributions
    0

    Default Re: Notifier question

    What a gem lat9 !

    I'm getting
    [02-Feb-2016 17:05:01 America/Chicago] Request URI: /tst154/index.php?main_page=checkout_success, IP address: xx.xx.xx.xx
    #1 mysqli_real_escape_string() called at [/includes/classes/db/mysql/query_factory.php:115]
    #2 queryFactory->prepare_input() called at [/includes/classes/db/mysql/query_factory.php:496]
    #3 queryFactory->prepareInput() called at [/includes/functions/functions_general.php:904]
    #4 zen_db_input() called at [/includes/classes/supertracker.php:183]
    #5 supertracker->update() called at [/includes/templates/MYTEMPLATE/jscript/jscript_supertracker.php:15]
    #6 require(/includes/templates/piccolo2/jscript/jscript_supertracker.php) called at [/includes/templates/template_default/common/html_header.php:129]
    #7 require(/includes/templates/template_default/common/html_header.php) called at [/index.php:43]

    [02-Feb-2016 17:05:01 America/Chicago] PHP Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /includes/classes/db/mysql/query_factory.php on line 115
    So my understanding is that I have to upgrade Supertracker, the problem is I already have the latest Supertracker 1.1, which says it is only compatible with 1.5.0 and not 1.5.4.

    So I'm tracking.
    Base ZC functions like prepare_input() or mysqli_real_escape_string(), can't be involved so, lines 1 to 3 can be forgotten.

    Line 4, hmmm..., super tracker line 183, let's see,
    Code:
          $db->Execute("UPDATE " . TABLE_SUPERTRACKER . "
                        SET last_click = NOW(),
                            exit_page='" . zen_db_input(zen_db_prepare_input(urldecode($_SERVER['REQUEST_URI']))) . "',
                            exit_page_name='" . $page_title . "',
                            num_clicks=num_clicks+1,
                            added_cart='" . zen_db_input($tracking_data->fields['added_cart']) . "',
                            categories_viewed='" . zen_db_input($categories_viewed) . "',
                            products_viewed='" . zen_db_input($tracking_data->fields['products_viewed']) . "',
                            customer_id='" . (int)$customer_id . "',
                            completed_purchase='" . zen_db_input($completed_purchase) . "',
                            cart_contents='" . zen_db_input($cart_contents) . "',
                            cart_total = '" . zen_db_input($cart_total) . "',
                            order_id = '" . (int)$order_id . "'
                        WHERE tracking_id='" . (int)$tracking_data->fields['tracking_id'] . "'");
              
          // SQL Injection Security Fix (Mathew Chan, 25 Feb 2009)
          // $db->prepareInput(zen_db_prepare_input(urldecode($_SERVER['REQUEST_URI'])))
          
          //$db->Execute("UPDATE " . TABLE_SUPERTRACKER . " SET last_click = NOW(), exit_page='" . zen_db_prepare_input(urldecode($_SERVER['REQUEST_URI'])) . "', exit_page_name='" . $page_title . "', num_clicks=num_clicks+1, added_cart='" . $tracking_data->fields['added_cart'] . "', categories_viewed='" . $categories_viewed . "', products_viewed='" . $tracking_data->fields['products_viewed'] . "', customer_id='" . $customer_id . "', completed_purchase='" . $completed_purchase . "', cart_contents='" . $cart_contents . "', cart_total = '" . $cart_total . "', order_id = '" . $order_id . "' WHERE tracking_id='" . $tracking_data->fields['tracking_id'] . "'");
    183 --- cart_contents='" . zen_db_input($cart_contents) . "'

    This doesn't seem to have anything special.
    Either I'm lost or it's again the beginning of the classe :
    class supertracker {

    function supertracker(){
    }
    Does using function __construct again will help ?
    I'm a bit... Sorry I'm completely lost

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Notifier question

    That log implies that the $cart_contents variable is (as the debug message indicates) an array as opposed to a string. You could "stringify" the value using the PHP implode function.

  6. #6
    Join Date
    Mar 2005
    Posts
    229
    Plugin Contributions
    0

    Default Re: Notifier question

    I've just dug into the code and I found

    Code:
     //Store away their cart contents
          //But, the cart is dumped at checkout, so we don't want to overwrite the stored cart contents
          //In this case
          $current_cart_contents = serialize($_SESSION['cart']->contents);
          if (strlen($current_cart_contents) > 6) {
            $cart_contents = $current_cart_contents;
            $cart_total = $_SESSION['cart']->show_total();
          }
    So the cart content should already be serialized.
    In the table I'm seeing, in former records
    a:1:{s:36:"287:207793b2351645b00ef85f38194431f7";a:2:{s:3:"qty";d:1;s:10:"attrib utes";a:1:{i:22;s:3:"100";}}}
    which is a serialized array, no ?

    The if (strlen($current_cart_contents) > 6) means if the cart contains something as a serialized array would give at least "x:y:{}" which makes 6 chars.


    So I don't see why the array is still an array...

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Notifier question

    Would you post (using the code-tags as you have previously) the contents of the supertracker-class function "leading up to" the error at line 183?

 

 

Similar Threads

  1. v151 Notifier help please
    By slobadog in forum General Questions
    Replies: 12
    Last Post: 7 Mar 2013, 11:14 AM
  2. Notifier trouble
    By ogradyjd in forum General Questions
    Replies: 2
    Last Post: 23 Jun 2009, 12:46 AM
  3. Notifier not Found
    By navdeep584 in forum General Questions
    Replies: 1
    Last Post: 9 Jun 2007, 06:09 PM
  4. Specific notifier question - experts please!
    By s_mack in forum General Questions
    Replies: 35
    Last Post: 22 Feb 2007, 08:01 AM
  5. Notifier Class - attempt
    By quentinjs in forum Templates, Stylesheets, Page Layout
    Replies: 20
    Last Post: 17 Oct 2006, 10:42 AM

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