Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Admin categories search -Creating default object from empty value (see in debug logs)

    vanilla install (+superglobals and backup mysql), local XAMPP install, MySQL 5.6.21, PHP 5.6.3

    Go into catalog and search for "music": an admin debug log is created.

    PHP Warning: Creating default object from empty value in ...\zc154\admin1\categories.php on line 1006

    line 1006
    PHP Code:
       $pInfo->products_id$pID
    Seems to be when a category is returned from a search, not nothing or products-only.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Admin debug logs - Creating default object from empty value - categories search

    I can reproduce this on my Zen Cart v1.5.4 when I have php 5.5 but not on my Zen Cart v1.5.4 when I have php 5.3.28 or php 5.3.29 ...

    We will have to check into this further ...
    Last edited by Ajeh; 14 Jan 2015 at 04:05 AM.
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Admin debug logs - Creating default object from empty value - categories search

    Any interesting point is that this appears to only be triggered when both 1 or more Categories and 1 or more Products are found in the search, such as in 'music' which is both a Category and a Product ...

    This will not trigger when only 1 or more Products are found, such as a search on 'DVD-DHWV' ...

    This will not trigger when only 1 or more Categories are found and no Products ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: Admin debug logs - Creating default object from empty value - categories search

    My hosting is php 5.4.34, does it there too.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Admin debug logs - Creating default object from empty value - categories search

    It's a result of PHP 5.4 becoming more strict in how it handles uninitialized objects.

    Fortunately it's only throwing a minor "warning", and not a fatal error.

    The solution may require a number of architectural changes, which may be relevant in other places also, so probably will be incorporated into a new version, and not treated as critical bugs.
    .

    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.

  6. #6
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: Admin debug logs - Creating default object from empty value - categories search

    I use the search extensively, could a few strategically placed "@" suppress the creation of these logs?
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Admin debug logs - Creating default object from empty value - categories search

    Before you bother with suppressing things, where *else* in the admin are you able to trigger the same kind of message?
    .

    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.

  8. #8
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: Admin debug logs - Creating default object from empty value - categories search

    I haven't seen it occur anywhere else.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  9. #9
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Admin debug logs - Creating default object from empty value - categories search

    To get rid of that warning entry in the log file, you can remove those lines causing it, as they're not used. It appears they're leftover from when that file was split into multiples for (slightly) easier maintenance:

    These at 1005-1007 in /admin/categories.php can be removed:
    Code:
    
      if (empty($pInfo->products_id)) {
        $pInfo->products_id= $pID;
      }
    
    .

    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. #10
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: Admin debug logs - Creating default object from empty value - categories search

    Additional information is that prior to commenting-out those lines, I found a note in my categories file at another point
    PHP Code:
    if (empty($pInfo->products_id)) {
        
    //$pInfo = new stdClass();//steve added to 1.53 for php 5.4 and E_STRICT warnings, removed for 1.54, maybe fixed?
        
    $pInfo->products_id$pID;
      } 
    If I re-enable that commented-out declaration, the error log does not occur.

    Which "solution" is recommended, or it really doesn't matter?
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 12
    Last Post: 31 Jul 2017, 11:57 PM
  2. 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
  3. v139h Creating default object from empty value (in shipping modules)
    By Phil S in forum General Questions
    Replies: 11
    Last Post: 6 Nov 2015, 06:46 AM
  4. Replies: 10
    Last Post: 6 Sep 2014, 02:55 AM
  5. Replies: 3
    Last Post: 26 Mar 2014, 07:35 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR