PHP Notices in log file

Joseph

02 Jul, 2012 10:37 PM

Couldn’t find your bug reporting / issue tracking site…
Just to let you know, Jigoshop is dumping Notices in the PHP log file when products without SKU and stock tracking are saved:

[02-Jul-2012 12:45:17] PHP Notice: Undefined index: sku in /…/htdocs/wp-content/plugins/jigoshop/admin/write-panels/product-data-save.php on line 70 [02-Jul-2012 12:45:17] PHP Stack trace: [02-Jul-2012 12:45:17] PHP 1. {main}() /…/htdocs/wp-admin/post.php:0 [02-Jul-2012 12:45:17] PHP 2. edit_post() /…/htdocs/wp-admin/post.php:195 [02-Jul-2012 12:45:17] PHP 3. wp_update_post() /…/htdocs/wp-admin/includes/post.php:230 [02-Jul-2012 12:45:17] PHP 4. wp_insert_post() /…/htdocs/wp-includes/post.php:2753 [02-Jul-2012 12:45:17] PHP 5. do_action() /…/htdocs/wp-includes/post.php:2698 [02-Jul-2012 12:45:17] PHP 6. call_user_func_array() /…/htdocs/wp-includes/plugin.php:403 [02-Jul-2012 12:45:17] PHP 7. jigoshop_meta_boxes_save() /…/htdocs/wp-includes/plugin.php:0 [02-Jul-2012 12:45:17] PHP 8. do_action() /…/htdocs/wp-content/plugins/jigoshop/admin/jigoshop-write-panels.php:66 [02-Jul-2012 12:45:17] PHP 9. call_user_func_array() /…/htdocs/wp-includes/plugin.php:403 [02-Jul-2012 12:45:17] PHP 10. jigoshop_product_meta->save() /…/htdocs/wp-includes/plugin.php:0

[02-Jul-2012 12:45:17] PHP Notice: Undefined index: stock_status in /…/htdocs/wp-content/plugins/jigoshop/admin/write-panels/product-data-save.php on line 160 [02-Jul-2012 12:45:17] PHP Stack trace: [02-Jul-2012 12:45:17] PHP 1. {main}() /…/htdocs/wp-admin/post.php:0 [02-Jul-2012 12:45:17] PHP 2. edit_post() /…/htdocs/wp-admin/post.php:195 [02-Jul-2012 12:45:17] PHP 3. wp_update_post() /…/htdocs/wp-admin/includes/post.php:230 [02-Jul-2012 12:45:17] PHP 4. wp_insert_post() /…/htdocs/wp-includes/post.php:2753 [02-Jul-2012 12:45:17] PHP 5. do_action() /…/htdocs/wp-includes/post.php:2698 [02-Jul-2012 12:45:17] PHP 6. call_user_func_array() /…/htdocs/wp-includes/plugin.php:403 [02-Jul-2012 12:45:17] PHP 7. jigoshop_meta_boxes_save() /…/htdocs/wp-includes/plugin.php:0 [02-Jul-2012 12:45:17] PHP 8. do_action() /…/htdocs/wp-content/plugins/jigoshop/admin/jigoshop-write-panels.php:66 [02-Jul-2012 12:45:17] PHP 9. call_user_func_array() /…/htdocs/wp-includes/plugin.php:403 [02-Jul-2012 12:45:17] PHP 10. jigoshop_product_meta->save() /…/htdocs/wp-includes/plugin.php:0 [02-Jul-2012 12:45:17] PHP 11. jigoshop_product_meta->process_stock() /…/htdocs/wp-content/plugins/jigoshop/admin/write-panels/product-data-save.php:78

  1. Support Staff 2 Posted by chriscct7 on 02 Jul, 2012 10:46 PM

    chriscct7's Avatar

    Hi,
    We’ll take care of moving for you if it turns out to be a non-isolated issue.
    Can your report both your PHP debug log logging settings, and also paste your Jigoshop System Info please.

    Thanks,
    Chris

  2. Support Staff 3 Posted by ivica on 04 Jul, 2012 05:09 PM

    ivica's Avatar

    Your Jigoshop System Info, please. Thx!

  3. 4 Posted by Joseph on 04 Jul, 2012 06:19 PM

    Begin System Info

    Theme:                    Blue Heron
    Multi-site:               No
    SITE_URL:                 http://blueheronpublishing.local
    HOME_URL:                 http://blueheronpublishing.local
    Jigoshop Version:         1.2.3
    WordPress Version:        3.4.1
    PHP Version:              5.2.6
    MySQL Version:            5.0.41
    Web Server Info:          Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2
    PHP Memory Limit:         256M
    PHP Post Max Size:        32M
    WP_DEBUG:                 Enabled
    Show On Front:            page
    Page On Front:            164
    Page For Posts:           0
    Session:                  Disabled
    Session Name:             PHPSESSID
    Cookie Path:              /
    Save Path:                /Applications/MAMP/tmp/php
    Use Cookies:              On
    Use Only Cookies:         Off
    UPLOAD_MAX_FILESIZE:      32MB
    POST_MAX_SIZE:            32MB
    WordPress Memory Limit:   32MB
    WP_DEBUG:                 On
    DISPLAY ERRORS:           On (1)
    FSOCKOPEN:                Your server supports fsockopen.
    ACTIVE PLUGINS:
    Contact Form 7: 3.2
    Contact Form 7 Honeypot: 1.0.0
    Display Posts Shortcode: 1.7
    JCK Fancy Product Preview: 1.1
    Jigoshop: 1.2.3
    jQuery Collapse-O-Matic: 1.4.4
    Regenerate Thumbnails: 2.2.3
    SpamSpan: 99.9  (nee 0.1)
    TB Testimonials: 1.6.0
    ### End System Info ###
    

    This was AFTER fixing a deprecation warning:
    “Notice: get_current_theme is deprecated since version 3.4! Use wp_get_theme() instead.” for line 176 in jigoshop-admin.php

    I’m happy to do a little leg work here to help track this down… let me know, I can revert to the parent theme (origin) and disable other plugins if it’d be helpful.

    thanks!!

  4. 5 Posted by Joseph on 04 Jul, 2012 06:21 PM

    Oh yes – I have WP_DEBUG = true
    but these notices were showing up in the php log file.

  5. Support Staff 6 Posted by chriscct7 on 04 Jul, 2012 06:24 PM

    chriscct7's Avatar

    Just out of curiousity, you have the settings require skus and stock manage for me unchecked right?

    -Chris

  6. 7 Posted by Joseph on 04 Jul, 2012 06:42 PM

    Right.

  7. Support Staff 8 Posted by chriscct7 on 04 Jul, 2012 07:35 PM

    chriscct7's Avatar

    Well this may or may not fix this issue, but you actually have another issue going on. Based on the Sys Info above your PHP Sessions are off, which is a major problem. Without this people can’t actually use your shop to shop (ie they can’t add product to cart. Session: Disabled
    This is a setting in your PHP.ini file your host provides in the root of the server.

    Try fixing this and see if it helps.

    -Chris

  8. Support Staff 9 Posted by Jeff on 15 Jul, 2012 01:46 PM

    Jeff's Avatar

    Just finishing off a few of the submitted bugs for version 1.3 and these 2 ‘undefined’ indexes are fixed.

  9. 10 Posted by Joseph on 15 Jul, 2012 06:06 PM

    This is a bit confusing?

    Jigoshop does start the session, and as far as I can tell, the session is active when the “Disabled” message gets printed. I added the following debug output to be sure:

    Session ID:               <?php echo session_id() . "n"; ?>
    <?php echo print_r($_SESSION['jigoshop'][JIGOSHOP_VERSION]); ?>)
    Session:                  <?php echo !empty($_SESSION['enableSessionsTest']) ? 'Enabled' : 'Disabled'; ?><?php echo "n"; ?>
    

    Here’s the output:

    Session ID:               eb3063cd37d1b756497f6ca7bf54246c
    Array
    (
    [customer] => Array
        (
            [country] => CA
            [state] => BC
            [postcode] => 
            [shipping_country] => CA
            [shipping_state] => BC
            [shipping_postcode] => 
        )
    [errors] => Array
        (
        )
    [messages] => Array
        (
        )
    )
    Session:                  Disabled
    

    I searched for the enableSessionsTest index, but it isn’t set anywhere, so no surprise that this comes out as “Disabled”…
    echo !empty($_SESSION['enableSessionsTest']) ? 'Enabled' : 'Disabled';

    or am I missing something?

    Again – happy to help out if I can.
    Thank you!!!!

  10. 11 Posted by Joseph on 15 Jul, 2012 06:09 PM

    BTW – sessions DO appear to be working correctly. Items are added to shopping cart and state is maintained over multiple requests.

  11. 12 Posted by Joseph on 15 Jul, 2012 06:11 PM

    Oh yes – and thanks Jeff for cleaning up those undefineds!!

  12. Support Staff 13 Posted by Jeff on 15 Jul, 2012 06:56 PM

    Jeff's Avatar

    Pay no attention to that ‘session: disabled’ line. Took a look at it, not sure what was intended there, … but there certainly is no such animal as ‘enableSessionsTest’ that it is testing.

    I’ll look into it, but you can happily ignore that as it’s quite bogus.

  13. 14 Posted by Joseph on 15 Jul, 2012 07:03 PM

    Thanks Jeff.
    that’s what I suspected.

    Perhaps a test on session_id() would make more sense here.

    thanks for the quick reply.
    Ciao.

Reply to this discussion

Internal reply

Formatting help or Preview

Attached Files

You can attach files up to 10MB

If you don’t have an account yet, we need to confirm you’re human and not a machine trying to post spam.