- This topic has 12 replies, 3 voices, and was last updated 5 years, 2 months ago by
Tom.
-
AuthorPosts
-
March 14, 2017 at 4:39 pm #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.45GP Premium 1.2.95March 14, 2017 at 4:41 pm #291576dmccan
I suppose I should say I’m using PHP 7.0.3 and WordPress 4.7.3.
March 14, 2017 at 4:54 pm #291583Tom
Lead DeveloperLead DeveloperHi 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
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 14, 2017 at 5:01 pm #291589dmccan
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.
March 14, 2017 at 5:03 pm #291593Tom
Lead DeveloperLead DeveloperYep, 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 π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 15, 2017 at 2:00 am #291898Tom
Lead DeveloperLead DeveloperHere’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!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 15, 2017 at 4:37 am #291999dmccan
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
March 15, 2017 at 8:32 am #292202Tom
Lead DeveloperLead DeveloperPerfect, thanks for letting me know!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 15, 2017 at 3:20 pm #292458Tom
Lead DeveloperLead Developer1.3.46 was just released which fixes this.
Thanks again!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 15, 2017 at 3:38 pm #292465Ben
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.
March 15, 2017 at 3:39 pm #292466Tom
Lead DeveloperLead DeveloperIt’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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 15, 2017 at 3:42 pm #292469Ben
Yup Fixed it. Thanks.
March 15, 2017 at 3:43 pm #292470Tom
Lead DeveloperLead DeveloperYou’re welcome π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.