Forums / General Questions / PHP 5.20 | Catchable fatal error | queryFactoryResult | functions_general.php

PHP 5.20 | Catchable fatal error | queryFactoryResult | functions_general.php

Locked

Started by sarahl on 5 Jun 2007, 11:06 AM · Views: 5,878

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
5 Jun 2007, 11:06 AM
#1
sarahl avatar

sarahl

Zen Follower

Join Date:
May 2004
Location:
UK
Posts:
471
Plugin Contributions:
0

PHP 5.20 | Catchable fatal error | queryFactoryResult | functions_general.php

Hi All

Well its been a joy trying to figure out this error, but on looking at PHP 5.2 and the worldpay module I was getting these error messages,

Catchable fatal error: Object of class queryFactoryResult could not be converted to string in functions_general.php

but the solution I found is this:

in includes/functions/functions_general.php

  function zen_not_null($value) {
    if (is_array($value)) {
      if (sizeof($value) > 0) {
        return true;
      } else {
        return false;
      }
    } else {
      if (($value != '') && (strtolower($value) != 'null') &&
(strlen(trim($value)) > 0)) { *** this line here
        return true;
      } else {
        return false;
      }
    }
  }

replace the whole section of code around line 660 with this:

  function zen_not_null($value) {
    if (is_array($value)) {
      if (sizeof($value) > 0) {
        return true;
      } else {
        return false;
      }
    } elseif( is_a( $value, 'queryFactoryResult' ) ) {
      if (sizeof($value->result) > 0) {
        return true;
      } else {
        return false;
      }
    } else {
      if (($value != '') && (strtolower($value) != 'null') &&
(strlen(trim($value)) > 0)) {
        return true;
      } else {
        return false;
      }
    }
  }

Its finally resolved my issue ! not sure if it will resolve anyone elses but thought that it might help someone by posting it - I am almost 100% sure its only linked if you have Worldpay set up :) Use at own risk.

thank you
Sarah

17 Aug 2007, 3:12 AM
#2
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: PHP 5.20 | Catchable fatal error | queryFactoryResult | functions_general.php

Hi, I am the same problems like you, do you are using 1.3.7 of Zen-Cart???

My server using PHP 5.2.3.

I am still have not testing this, if successful, I will post here later...

Otherware, thank you to share this experience and the code.

17 Aug 2007, 7:19 AM
#3
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: PHP 5.20 | Catchable fatal error | queryFactoryResult | functions_general.php

Thank you very much, it work on 1.3.7 with PHP 5.3.2

Tested!!!