Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,541
    Plugin Contributions
    127

    Default Re: var-type undefined: stringIgnoreNull(Daniel) - Account Edit

    Note that the full name of this file is:

    ./includes/classes/db/mysql/query_factory.php

    (for people searching for "query_factory.php")
    Last edited by swguy; 4 Jun 2017 at 12:25 PM.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  2. #12
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,970
    Plugin Contributions
    96

    Default Re: var-type undefined: stringIgnoreNull(Daniel) - Account Edit

    It would be "really nice" if that function could be updated to log the issue rather than simply displaying it, i.e. changing the 1.5.5a version from:
    Code:
      function getBindVarValue($value, $type) {
        $typeArray = explode(':',$type);
        $type = $typeArray[0];
        switch ($type) {
          case 'csv':
            return $value;
          break;
          case 'passthru':
            return $value;
          break;
          case 'float':
            return (!zen_not_null($value) || $value=='' || $value == 0) ? 0 : $value;
          break;
          case 'integer':
            return (int)$value;
          break;
          case 'string':
            if (preg_match('/NULL/', $value)) return 'null';
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'stringIgnoreNull':
            return '\'' . $this->prepare_input($value) . '\'';
            break;
          case 'noquotestring':
            return $this->prepare_input($value);
          break;
          case 'currency':
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'date':
            if (preg_match('/null/i', $value)) return 'null';
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'enum':
            if (isset($typeArray[1])) {
              $enumArray = explode('|', $typeArray[1]);
            }
            return '\'' . $this->prepare_input($value) . '\'';
          case 'regexp':
            $searchArray = array('[', ']', '(', ')', '{', '}', '|', '*', '?', '.', '$', '^');
            foreach ($searchArray as $searchTerm) {
              $value = str_replace($searchTerm, '\\' . $searchTerm, $value);
            }
            return $this->prepare_input($value);
          default:
          die('var-type undefined: ' . $type . '('.$value.')');
        }
      }
    to
    Code:
      function getBindVarValue($value, $type) {
        $typeArray = explode(':',$type);
        $type = $typeArray[0];
        switch ($type) {
          case 'csv':
            return $value;
          break;
          case 'passthru':
            return $value;
          break;
          case 'float':
            return (!zen_not_null($value) || $value=='' || $value == 0) ? 0 : $value;
          break;
          case 'integer':
            return (int)$value;
          break;
          case 'string':
            if (preg_match('/NULL/', $value)) return 'null';
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'stringIgnoreNull':
            return '\'' . $this->prepare_input($value) . '\'';
            break;
          case 'noquotestring':
            return $this->prepare_input($value);
          break;
          case 'currency':
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'date':
            if (preg_match('/null/i', $value)) return 'null';
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'enum':
            if (isset($typeArray[1])) {
              $enumArray = explode('|', $typeArray[1]);
            }
            return '\'' . $this->prepare_input($value) . '\'';
          case 'regexp':
            $searchArray = array('[', ']', '(', ')', '{', '}', '|', '*', '?', '.', '$', '^');
            foreach ($searchArray as $searchTerm) {
              $value = str_replace($searchTerm, '\\' . $searchTerm, $value);
            }
            return $this->prepare_input($value);
          default:
          trigger_error ("var-type undefined: $type ($value).", E_USER_ERROR);
        }
      }

  3. #13
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: var-type undefined: stringIgnoreNull(Daniel) - Account Edit

    trigger_error - I like how things look so simple !
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  4. #14
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: var-type undefined: stringIgnoreNull(Daniel) - Account Edit

    Quote Originally Posted by lat9 View Post
    It would be "really nice" if that function could be updated to log the issue rather than simply displaying it, i.e. changing the 1.5.5a version from:
    Code:
      function getBindVarValue($value, $type) {
        $typeArray = explode(':',$type);
        $type = $typeArray[0];
        switch ($type) {
          case 'csv':
            return $value;
          break;
          case 'passthru':
            return $value;
          break;
          case 'float':
            return (!zen_not_null($value) || $value=='' || $value == 0) ? 0 : $value;
          break;
          case 'integer':
            return (int)$value;
          break;
          case 'string':
            if (preg_match('/NULL/', $value)) return 'null';
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'stringIgnoreNull':
            return '\'' . $this->prepare_input($value) . '\'';
            break;
          case 'noquotestring':
            return $this->prepare_input($value);
          break;
          case 'currency':
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'date':
            if (preg_match('/null/i', $value)) return 'null';
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'enum':
            if (isset($typeArray[1])) {
              $enumArray = explode('|', $typeArray[1]);
            }
            return '\'' . $this->prepare_input($value) . '\'';
          case 'regexp':
            $searchArray = array('[', ']', '(', ')', '{', '}', '|', '*', '?', '.', '$', '^');
            foreach ($searchArray as $searchTerm) {
              $value = str_replace($searchTerm, '\\' . $searchTerm, $value);
            }
            return $this->prepare_input($value);
          default:
          die('var-type undefined: ' . $type . '('.$value.')');
        }
      }
    to
    Code:
      function getBindVarValue($value, $type) {
        $typeArray = explode(':',$type);
        $type = $typeArray[0];
        switch ($type) {
          case 'csv':
            return $value;
          break;
          case 'passthru':
            return $value;
          break;
          case 'float':
            return (!zen_not_null($value) || $value=='' || $value == 0) ? 0 : $value;
          break;
          case 'integer':
            return (int)$value;
          break;
          case 'string':
            if (preg_match('/NULL/', $value)) return 'null';
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'stringIgnoreNull':
            return '\'' . $this->prepare_input($value) . '\'';
            break;
          case 'noquotestring':
            return $this->prepare_input($value);
          break;
          case 'currency':
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'date':
            if (preg_match('/null/i', $value)) return 'null';
            return '\'' . $this->prepare_input($value) . '\'';
          break;
          case 'enum':
            if (isset($typeArray[1])) {
              $enumArray = explode('|', $typeArray[1]);
            }
            return '\'' . $this->prepare_input($value) . '\'';
          case 'regexp':
            $searchArray = array('[', ']', '(', ')', '{', '}', '|', '*', '?', '.', '$', '^');
            foreach ($searchArray as $searchTerm) {
              $value = str_replace($searchTerm, '\\' . $searchTerm, $value);
            }
            return $this->prepare_input($value);
          default:
          trigger_error ("var-type undefined: $type ($value).", E_USER_ERROR);
        }
      }
    lat9, are you encountering cases where that scenario actually occurs?
    .

    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. #15
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,970
    Plugin Contributions
    96

    Default Re: var-type undefined: stringIgnoreNull(Daniel) - Account Edit

    Quote Originally Posted by DrByte View Post
    lat9, are you encountering cases where that scenario actually occurs?
    I've only run into that scenario during a customization's development. I'll admit that it threw me off a bit and took additional time to debug, but no "production" cases where that issue arises.

  6. #16
    Join Date
    Aug 2011
    Posts
    104
    Plugin Contributions
    0

    Default Re: var-type undefined: stringIgnoreNull(Daniel) - Account Edit

    I had the same issue, upgrading from 1.5.4 to 1.5.5a. Reuploading (or uploading for the first time?) the query_factory file seems to have resolved it.

  7. #17
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,541
    Plugin Contributions
    127

    Default Re: var-type undefined: stringIgnoreNull(Daniel) - Account Edit

    Note that ./includes/classes/db/mysql/query_factory.php changed from 1.5.5 to 1.5.5a, so if you upgraded but neglected to upgrade this file, or used the 1.5.5 copy, that would cause this problem.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  8. #18
    Join Date
    Jan 2016
    Location
    Toronto
    Posts
    23
    Plugin Contributions
    0

    Default Re: var-type undefined: stringIgnoreNull(Daniel) - Account Edit

    It's possibly uglier? I downloaded 1.5.5a from git-hub,

    * @version GIT: $Id: Author: Ian Wilson Modified in v1.6.0 $

    which has different definition for 'string' and no definition for 'stringIgnoreNull'

    Is it now being taken out of the latest code?

    Ouch!

  9. #19
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: var-type undefined: stringIgnoreNull(Daniel) - Account Edit

    Quote Originally Posted by DTomlinson View Post
    It's possibly uglier? I downloaded 1.5.5a from git-hub,

    * @version GIT: $Id: Author: Ian Wilson Modified in v1.6.0 $

    which has different definition for 'string' and no definition for 'stringIgnoreNull'

    Is it now being taken out of the latest code?

    Ouch!
    Are you trying to say something's not working properly in your v155 site?
    .

    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.

  10. #20
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,541
    Plugin Contributions
    127

    Default Re: var-type undefined: stringIgnoreNull(Daniel) - Account Edit

    This should only happen in situations where there are customizations that have not been brought up to date. Prior to the Trustwave fixes, the array to be passed to $db->perform could be updated like this:

    Code:
              $sql_data_array['tax_id'] = $tax_id;
              $sql_data_array['tax_exempt'] = $tax_exempt;
    Now it needs to be updated like this:

    Code:
              $sql_data_array[] = array('fieldName'=>'tax_id', 'value'=>$tax_id, 'type'=>'stringIgnoreNull');
              $sql_data_array[] = array('fieldName'=>'tax_exempt', 'value'=>$tax_exempt, 'type'=>'stringIgnoreNull');
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Product Type - Fatal error: Call to undefined function
    By DeeR in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 17 May 2010, 03:57 AM
  2. New Product type - typefilter url var results in blank page
    By GuitsBoy in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 24 Dec 2007, 09:33 PM
  3. Edit/Update Account Doesn't Work after Adding a new Account Field
    By webomat in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 19 Apr 2007, 04:51 AM
  4. Replies: 1
    Last Post: 8 Nov 2006, 12:41 AM
  5. Replies: 2
    Last Post: 19 Aug 2006, 09:01 PM

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