[Resolved] Getting PHP errors – Just installed latest version

Home Forums Support Getting PHP errors – Just installed latest version

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #291575
    dmccan

    Hi, I’m working on a development localhost site. I just updated the theme to 1.3.45 and the plugin to 1.2.95. I got a bunch of PHP errors when I saved a post. I disabled all plugins and switched to the 2012 theme and there were no errors when I save a post. I enabled only the GeneratePress theme (no plugins) and I get the error. I spun up a new blank site and installed the generatepress theme and get the error when I save a post, but not when using the 2017 theme.

    ( ! ) Notice: Undefined offset: 0 in E:\UwAmp\www\generate\wp-includes\capabilities.php on line 122
    Call Stack
    # Time Memory Function Location
    1 0.0005 437888 {main}( ) …\post.php:0
    2 0.1451 20837248 edit_post( ) …\post.php:193
    3 0.1752 20836904 wp_update_post( ) …\post.php:378
    4 0.1774 20863200 wp_insert_post( ) …\post.php:3578
    5 0.4698 20927360 do_action( ) …\post.php:3505
    6 0.4698 20927632 WP_Hook->do_action( ) …\plugin.php:453
    7 0.4698 20927656 WP_Hook->apply_filters( ) …\class-wp-hook.php:323
    8 0.4700 20928216 generate_save_layout_meta( ) …\class-wp-hook.php:300
    9 0.4701 20928248 current_user_can( ) …\metaboxes.php:102
    10 0.4701 20928520 WP_User->has_cap( ) …\capabilities.php:530
    11 0.4701 20928792 map_meta_cap( ) …\class-wp-user.php:723

    ( ! ) Notice: Undefined offset: 0 in E:\UwAmp\www\generate\wp-includes\capabilities.php on line 122
    Call Stack
    # Time Memory Function Location
    1 0.0005 437888 {main}( ) …\post.php:0
    2 0.1451 20837248 edit_post( ) …\post.php:193
    3 0.1752 20836904 wp_update_post( ) …\post.php:378
    4 0.1774 20863200 wp_insert_post( ) …\post.php:3578
    5 0.4698 20927360 do_action( ) …\post.php:3505
    6 0.4698 20927632 WP_Hook->do_action( ) …\plugin.php:453
    7 0.4698 20927656 WP_Hook->apply_filters( ) …\class-wp-hook.php:323
    8 0.4705 20928024 generate_save_footer_widget_meta( ) …\class-wp-hook.php:300
    9 0.4705 20928056 current_user_can( ) …\metaboxes.php:213
    10 0.4706 20928328 WP_User->has_cap( ) …\capabilities.php:530
    11 0.4706 20928600 map_meta_cap( ) …\class-wp-user.php:723

    ( ! ) Notice: Undefined offset: 0 in E:\UwAmp\www\generate\wp-includes\capabilities.php on line 122
    Call Stack
    # Time Memory Function Location
    1 0.0005 437888 {main}( ) …\post.php:0
    2 0.1451 20837248 edit_post( ) …\post.php:193
    3 0.1752 20836904 wp_update_post( ) …\post.php:378
    4 0.1774 20863200 wp_insert_post( ) …\post.php:3578
    5 0.4698 20927360 do_action( ) …\post.php:3505
    6 0.4698 20927632 WP_Hook->do_action( ) …\plugin.php:453
    7 0.4698 20927656 WP_Hook->apply_filters( ) …\class-wp-hook.php:323
    8 0.4710 20928104 generate_save_page_builder_meta( ) …\class-wp-hook.php:300
    9 0.4711 20928136 current_user_can( ) …\metaboxes.php:311
    10 0.4711 20928408 WP_User->has_cap( ) …\capabilities.php:530
    11 0.4711 20928680 map_meta_cap( ) …\class-wp-user.php:723

    ( ! ) Warning: Cannot modify header information – headers already sent by (output started at E:\UwAmp\www\generate\wp-includes\capabilities.php:122) in E:\UwAmp\www\generate\wp-admin\post.php on line 197
    Call Stack
    # Time Memory Function Location
    1 0.0005 437888 {main}( ) …\post.php:0
    2 0.5003 20892736 setcookie ( ) …\post.php:197

    ( ! ) Warning: Cannot modify header information – headers already sent by (output started at E:\UwAmp\www\generate\wp-includes\capabilities.php:122) in E:\UwAmp\www\generate\wp-includes\pluggable.php on line 1179
    Call Stack
    # Time Memory Function Location
    1 0.0005 437888 {main}( ) …\post.php:0
    2 0.5004 20892872 redirect_post( ) …\post.php:200
    3 0.5007 20892944 wp_redirect( ) …\post.php:1854
    4 0.5007 20894920 header ( ) …\pluggable.php:1179
    `

    Thank you for any suggestions.

    David

    GeneratePress 1.3.45
    GP Premium 1.2.95
    #291576
    dmccan

    I suppose I should say I’m using PHP 7.0.3 and WordPress 4.7.3.

    #291583
    Tom
    Lead Developer
    Lead Developer

    Hi David,

    Thanks for reporting this! A user capability check was added when saving meta boxes for security purposes, however the post ID was omitted from the function which can cause these warnings.

    I’ve made the change and will push out an update after waiting a few hours to see if anything else pops up.

    For now, you can turn off WP_DEBUG on your WP installation to avoid the warnings: https://codex.wordpress.org/WP_DEBUG

    #291589
    dmccan

    Glad to hear that you find the problem. In case it helps, I reverted to the previous version of the theme and with the plugin disabled there was no error, but with the plugin enabled I got an error. In other words, I was able to produce an error with the previous version of the theme and new version or the plugin AND with just the new version of the theme. I know they work together, just mentioning it in case it is useful info.

    #291593
    Tom
    Lead Developer
    Lead Developer

    Yep, it’s due to the capability check which was added for extra security in both versions.

    I’ll see if anything else pops up within the next few hours and will release updates with the fix 🙂

    #291898
    Tom
    Lead Developer
    Lead Developer

    Here’s a fix if you need it before 1.3.46 is released: https://generatepress.com/forums/topic/1-3-45-notice-undefined-offset/

    It would be great if you could confirm that it clears up the issue 🙂

    Thanks!

    #291999
    dmccan

    Hi Tom,

    I installed the plugin version 1.2.96 and the theme version 1.3.46-beta and was able to save a post with debugging on and got no errors.

    Regards,

    David

    #292202
    Tom
    Lead Developer
    Lead Developer

    Perfect, thanks for letting me know!

    #292458
    Tom
    Lead Developer
    Lead Developer

    1.3.46 was just released which fixes this.

    Thanks again!

    #292465
    Ben

    I updated to the latest theme and plugin around 12 PST. Broke my Main Menu in the header. There was no padding between the nav links. They looked all clumped up. I restored to yesterday’s backup. I currently updated the plugin to the latest version but not the theme.

    #292466
    Tom
    Lead Developer
    Lead Developer

    It’s likely that you’re removing query strings from your files. You probably just need to clear your browser cache once you update and you’ll be good to go.

    #292469
    Ben

    Yup Fixed it. Thanks.

    #292470
    Tom
    Lead Developer
    Lead Developer
Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.