Zen Cart Logo
Forums / Bug Reports / [Done v1.5.5] PHP 5.4 default object from empty value warning

[Done v1.5.5] PHP 5.4 default object from empty value warning

Views: 2,071

Results 1 to 2 of 2
21 Oct 2014, 10:14 PM
#1
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

[Done v1.5.5] PHP 5.4 default object from empty value warning

Evidently, PHP changed the way how objects work in the new 5.4 version. I noticed that I started to get these alot:

[21-Oct-2014 15:27:04 America/New_York] PHP Warning: Creating default object from empty value in /home/someuser/public_html/example.com/admin/attributes_controller.php on line 924

To "fix" this, I changed that particular line from this:

if ($action == 'attributes_preview') {
  $_GET['products_id'] = $products_filter;
  $pInfo->products_id = $products_filter;
  include(DIR_WS_INCLUDES . 'attributes_preview.php');
?>

to this:

if ($action == 'attributes_preview') {
  $_GET['products_id'] = $products_filter;

  if (!isset($pInfo)) $pInfo = new stdClass();
  $pInfo->products_id = $products_filter;

  include(DIR_WS_INCLUDES . 'attributes_preview.php');
?>

Hope this helps.

7 Sep 2016, 2:42 PM
#2
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: [Done v1.5.5] PHP 5.4 default object from empty value warning

these kind of errors are generally related to ZC - PHP mismatches.

that appears to be resolved by ZC 1.5.5