Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jun 2010
    Posts
    145
    Plugin Contributions
    0

    Default Debug file in /logs - PHP Warning: Creating default object from empty value

    New-ish install of 1.5.3 with only one plugin installed (Encrypted Master Password v. 2.0.0). I had one log from 8/8 and one log from 8/10, both of which contained this error:
    Code:
    PHP Warning:  Creating default object from empty value in /home/user/public/catalog/myadmin/categories.php on line 1006
    I checked my version of admin/categories against an unmodified version and they are exactly the same. Any idea what might be causing this? I saw a couple of threads from a year or so ago that PHP 5.4 upgrades were causing some similar issues, but I didn't know if this might be related or not. Thanks! :)

  2. #2
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Debug file in /logs - PHP Warning: Creating default object from empty value

    Quote Originally Posted by laurelsstitchery View Post
    New-ish install of 1.5.3 with only one plugin installed (Encrypted Master Password v. 2.0.0). I had one log from 8/8 and one log from 8/10, both of which contained this error:
    Code:
    PHP Warning:  Creating default object from empty value in /home/user/public/catalog/myadmin/categories.php on line 1006
    I checked my version of admin/categories against an unmodified version and they are exactly the same. Any idea what might be causing this? I saw a couple of threads from a year or so ago that PHP 5.4 upgrades were causing some similar issues, but I didn't know if this might be related or not. Thanks! :)
    A couple of things can be done to sleuth this out. One is to install a mod that lat9 put together. I think it is called mydebug backtrace. This error is generated at the categories.php file, but the problem occurred somewhere upstream of it.

    The other thing you could do is review your admin activity logs for those dates and identify what was being done around that time frame to support reproducing the error. Then once the above plugin is installed and action taken to reproduce the error, more useful information should be inthe mydebug file to track down what is causing the issue.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jun 2010
    Posts
    145
    Plugin Contributions
    0

    Default Re: Debug file in /logs - PHP Warning: Creating default object from empty value

    Quote Originally Posted by mc12345678 View Post
    A couple of things can be done to sleuth this out. One is to install a mod that lat9 put together. I think it is called mydebug backtrace. This error is generated at the categories.php file, but the problem occurred somewhere upstream of it.

    The other thing you could do is review your admin activity logs for those dates and identify what was being done around that time frame to support reproducing the error. Then once the above plugin is installed and action taken to reproduce the error, more useful information should be inthe mydebug file to track down what is causing the issue.
    Thanks for the advice. I will get lat9's backtrace installed and see if I can ferret out what's going on. Whatever it is, it doesn't happen very often. I just checked the logs again and there weren't any additional errors, since the one on the 10th. :)

  4. #4
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Debug file in /logs - PHP Warning: Creating default object from empty value

    Quote Originally Posted by laurelsstitchery View Post
    Thanks for the advice. I will get lat9's backtrace installed and see if I can ferret out what's going on. Whatever it is, it doesn't happen very often. I just checked the logs again and there weren't any additional errors, since the one on the 10th. :)
    Good to know that whatever was being done to cause the problem hasn't been done since. :)

    To be sure that I was clear, when I stated to review the admin activity logs, those are the logs that are available from the admin panel, admin options on the right side, and then admin activity logs. These are different than the error logs that have been identified. With those logs exported securely to a local computer, they could be reviewed and possibly the action(s) taken just before the occurrence of the errors could be identified. And as said with that knowledge in hand can take the same action to try to generate the error.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Aug 2014
    Location
    Indonesia
    Posts
    2
    Plugin Contributions
    0

    Default Re: Debug file in /logs - PHP Warning: Creating default object from empty value

    also happen to me when activating/deactivating a product, or adding new products
    my version is 1.5.3 (updated from 1.5.1)

    exactly the same error

    PHP Warning: Creating default object from empty value in ---/admin/categories.php on line 1006
    Last edited by sadris; 31 Aug 2014 at 01:50 PM.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,905
    Plugin Contributions
    96

    Default Re: Debug file in /logs - PHP Warning: Creating default object from empty value

    I've seen that warning a couple of times, but wasn't able to reproduce it in my test installation (PHP 5.4.27/XAMPP). I believe, however, that the following teeny change to /YOUR_ADMIN/categories.php (around line 1006) will make the PHP interpreter happy:
    Code:
    <?php
    // Split Page
    if ($products_query_numrows > 0) {
    //-bof-20140830-lat9-Make sure that pInfo is an object ...
      if (!(isset ($pInfo) && is_object ($pInfo))) {
        $pInfo = new objectInfo (array ());
        
      }
    //-eof-20140830-lat9
      if (empty($pInfo->products_id)) {
        $pInfo->products_id= $pID;
      }
    ?>

  7. #7
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: Debug file in /logs - PHP Warning: Creating default object from empty value

    Will that same code work for the same error generated on line 1041?
    Code:
    PHP Warning:  Creating default object from empty value in /home/XXXXXX/public_html/XXXXXX/categories.php on line 1041
    According to DrByte:
    www.zen-cart.com/showthread.php?214369-myDEBUG-after-update-to-php-5-4-31
    It's harmless.
    It's a PHP 5.4 issue, where the use of an object element (in this case $pInfo) is assumed to already exist, but in this specific case it doesn't yet. So, the message is telling you that it created the object on-the-fly for you.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,905
    Plugin Contributions
    96

    Default Re: Debug file in /logs - PHP Warning: Creating default object from empty value

    Quote Originally Posted by RixStix View Post
    Will that same code work for the same error generated on line 1041?
    Code:
    PHP Warning:  Creating default object from empty value in /home/XXXXXX/public_html/XXXXXX/categories.php on line 1041
    According to DrByte:
    www.zen-cart.com/showthread.php?214369-myDEBUG-after-update-to-php-5-4-31
    The "stock" version of /YOUR_ADMIN/categories.php has only 1032 lines, so I can't answer the first question without seeing what's 'around' that line in your version.

    While it's a harmless message, my concern is that these "harmless" reports will make people complacent about seeing debug-log files such that they ignore an "important" report.

  9. #9
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: Debug file in /logs - PHP Warning: Creating default object from empty value

    Quote Originally Posted by lat9 View Post
    The "stock" version of /YOUR_ADMIN/categories.php has only 1032 lines, so I can't answer the first question without seeing what's 'around' that line in your version.

    While it's a harmless message, my concern is that these "harmless" reports will make people complacent about seeing debug-log files such that they ignore an "important" report.
    I think it is the same line of code. QuickQuantityUpdate referenced in the other thread adds a few lines toward the top which probably caused the lines to shift down that much.

    /admin/categories.php
    Code:
    // Split Page LINE 1038
    if ($products_query_numrows > 0) {
      if (empty($pInfo->products_id)) {
        $pInfo->products_id= $pID;
      }
    ?>
                <td class="smallText" align="center"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS) . '<br>' . $products_split->display_links($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y', 'pID')) ); ?></td>
    
    <?php
    }
    // Split Page LINE 1048
    Yes, I agree since I have started ignoring/deleting the myDebug files since most have been "Ignore them". I thought that I was being helpful in reporting the logs but it doesn't appear helpful at all. PayPal and this one are most frequent. There's really no dedicated area in the forum for questions related to myDebug, the questions tend to get sprinkled around.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,905
    Plugin Contributions
    96

    Default Re: Debug file in /logs - PHP Warning: Creating default object from empty value

    Quote Originally Posted by RixStix View Post
    I think it is the same line of code. QuickQuantityUpdate referenced in the other thread adds a few lines toward the top which probably caused the lines to shift down that much.

    /admin/categories.php
    Code:
    // Split Page LINE 1038
    if ($products_query_numrows > 0) {
      if (empty($pInfo->products_id)) {
        $pInfo->products_id= $pID;
      }
    ?>
                <td class="smallText" align="center"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS) . '<br>' . $products_split->display_links($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y', 'pID')) ); ?></td>
    
    <?php
    }
    // Split Page LINE 1048
    Yes, I agree since I have started ignoring/deleting the myDebug files since most have been "Ignore them". I thought that I was being helpful in reporting the logs but it doesn't appear helpful at all. PayPal and this one are most frequent. There's really no dedicated area in the forum for questions related to myDebug, the questions tend to get sprinkled around.
    Yes, the change that I posted should replace the same fragment in your (larger) file!

    I believe that your reporting of these warnings is quite helpful; many times a warning in one PHP version leads to an error in a later version. I also agree that having a dedicated "I got this debug-log, what does it mean?" forum would be helpful.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Warning: Creating default object from empty value in shipping_estimator.php
    By split63 in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 30 Apr 2016, 08:00 PM
  2. Replies: 11
    Last Post: 15 Jan 2015, 05:40 PM
  3. Replies: 20
    Last Post: 7 Dec 2014, 11:29 AM
  4. Replies: 3
    Last Post: 26 Mar 2014, 07:35 PM
  5. Replies: 0
    Last Post: 27 Sep 2012, 11:57 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