New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 7: Notice: Array to string conversion #272

Closed
raamdev opened this Issue Jun 2, 2016 · 17 comments

Comments

Projects
None yet
3 participants
@raamdev
Contributor

raamdev commented Jun 2, 2016

When leaving a reply on a comment and choosing to subscribe to replies to my comment, I'm getting the following notice (tested with the latest Comment Mail Pro on the 000000-dev branch; also had this happen with the latest public release of Comment Mail Lite v160213).

Despite this notice, the subscription does appear to get created in Comment Mail, however the status says unconfirmed, despite Auto-Confirm Everyone enabled in Comment Mail → Config. Options → Auto-Confirm Settings (is that perhaps a separate bug?).

Errors when testing the dev branch on 2016-06-08:

PHP Notice:  Array to string conversion in /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php on line 1026
PHP Stack trace:
PHP   1. {main}() /srv/www/wordpress-default/wp-comments-post.php:0
PHP   2. wp_handle_comment_submission($comment_data = array ('comment' => 'test!!', 'author' => 'test2', 'email' => 'test@test2.com', 'url' => '', 'comment_mail_sub_type' => 'comment', 'comment_mail_sub_deliver' => 'asap', 'submit' => 'Submit Comment', 'comment_post_ID' => '1740', 'comment_parent' => '0')) /srv/www/wordpress-default/wp-comments-post.php:20
PHP   3. wp_new_comment($commentdata = array ('comment_post_ID' => 1740, 'comment_author' => 'test2', 'comment_author_email' => 'test@test2.com', 'comment_author_url' => '', 'comment_content' => 'test!!', 'comment_type' => '', 'comment_parent' => 0, 'comment_author_IP' => '192.168.50.1', 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36', 'comment_date' => '2016-06-08 11:55:21', 'comment_date_gmt' => '2016-06-08 15:55:21', 'filtered' => TRUE, 'comment_approved' => 1)) /srv/www/wordpress-default/wp-includes/comment.php:2918
PHP   4. do_action($tag = 'comment_post', $arg = 45, 1, array ('comment_post_ID' => 1740, 'comment_author' => 'test2', 'comment_author_email' => 'test@test2.com', 'comment_author_url' => '', 'comment_content' => 'test!!', 'comment_type' => '', 'comment_parent' => 0, 'comment_author_IP' => '192.168.50.1', 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36', 'comment_date' => '2016-06-08 11:55:21', 'comment_date_gmt' => '2016-06-08 15:55:21', 'filtered' => TRUE, 'comment_approved' => 1)) /srv/www/wordpress-default/wp-includes/comment.php:1821
PHP   5. WebSharks\CommentMail\Plugin->commentPost($comment_id = 45, $comment_status = 1) /srv/www/wordpress-default/wp-includes/plugin.php:525
PHP   6. WebSharks\CommentMail\CommentPost->__construct($comment_id = 45, $comment_status = 1) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/Plugin.php:2403
PHP   7. WebSharks\CommentMail\CommentPost->maybeInjectSub() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/CommentPost.php:54
PHP   8. WebSharks\CommentMail\SubInjector->__construct($user = class WP_User { public $data = class stdClass {  }; public $ID = 0; public $caps = array (); public $cap_key = NULL; public $roles = array (); public $allcaps = array (); public $filter = NULL }, $comment_id = 45, $args = array ('type' => 'comment', 'deliver' => 'asap', 'auto_confirm' => NULL, 'process_events' => TRUE, 'process_list_server' => FALSE, 'user_initiated' => TRUE, 'keep_existing' => TRUE)) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/CommentPost.php:95
PHP   9. WebSharks\CommentMail\SubInjector->maybeInject() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInjector.php:142
PHP  10. WebSharks\CommentMail\SubInserter->__construct($request_args = array ('ID' => NULL, 'key' => NULL, 'user_id' => 0, 'post_id' => '1740', 'comment_id' => '45', 'deliver' => 'asap', 'fname' => 'test2', 'lname' => '', 'email' => 'test@test2.com', 'insertion_ip' => NULL, 'insertion_region' => NULL, 'insertion_country' => NULL, 'last_ip' => NULL, 'last_region' => NULL, 'last_country' => NULL, 'status' => NULL, 'insertion_time' => NULL, 'last_update_time' => NULL), $args = array ('auto_confirm' => NULL, 'process_events' => TRUE, 'process_confirmation' => TRUE, 'process_list_server' => FALSE, 'user_initiated' => TRUE, 'ui_protected_data_keys_enable' => FALSE, 'ui_protected_data_user' => NULL, 'user_allow_0' => NULL, 'keep_existing' => TRUE, 'check_blacklist' => TRUE)) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInjector.php:199
PHP  11. WebSharks\CommentMail\SubInserter->maybeInsertUpdate() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:479
PHP  12. WebSharks\CommentMail\SubInserter->insert() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:695
PHP  13. WebSharks\CommentMail\SubInserter->overwriteAnyOthersAfterInsertUpdate() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:766
PHP Notice:  Array to string conversion in /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php on line 1029
PHP Stack trace:
PHP   1. {main}() /srv/www/wordpress-default/wp-comments-post.php:0
PHP   2. wp_handle_comment_submission($comment_data = array ('comment' => 'test!!', 'author' => 'test2', 'email' => 'test@test2.com', 'url' => '', 'comment_mail_sub_type' => 'comment', 'comment_mail_sub_deliver' => 'asap', 'submit' => 'Submit Comment', 'comment_post_ID' => '1740', 'comment_parent' => '0')) /srv/www/wordpress-default/wp-comments-post.php:20
PHP   3. wp_new_comment($commentdata = array ('comment_post_ID' => 1740, 'comment_author' => 'test2', 'comment_author_email' => 'test@test2.com', 'comment_author_url' => '', 'comment_content' => 'test!!', 'comment_type' => '', 'comment_parent' => 0, 'comment_author_IP' => '192.168.50.1', 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36', 'comment_date' => '2016-06-08 11:55:21', 'comment_date_gmt' => '2016-06-08 15:55:21', 'filtered' => TRUE, 'comment_approved' => 1)) /srv/www/wordpress-default/wp-includes/comment.php:2918
PHP   4. do_action($tag = 'comment_post', $arg = 45, 1, array ('comment_post_ID' => 1740, 'comment_author' => 'test2', 'comment_author_email' => 'test@test2.com', 'comment_author_url' => '', 'comment_content' => 'test!!', 'comment_type' => '', 'comment_parent' => 0, 'comment_author_IP' => '192.168.50.1', 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36', 'comment_date' => '2016-06-08 11:55:21', 'comment_date_gmt' => '2016-06-08 15:55:21', 'filtered' => TRUE, 'comment_approved' => 1)) /srv/www/wordpress-default/wp-includes/comment.php:1821
PHP   5. WebSharks\CommentMail\Plugin->commentPost($comment_id = 45, $comment_status = 1) /srv/www/wordpress-default/wp-includes/plugin.php:525
PHP   6. WebSharks\CommentMail\CommentPost->__construct($comment_id = 45, $comment_status = 1) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/Plugin.php:2403
PHP   7. WebSharks\CommentMail\CommentPost->maybeInjectSub() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/CommentPost.php:54
PHP   8. WebSharks\CommentMail\SubInjector->__construct($user = class WP_User { public $data = class stdClass {  }; public $ID = 0; public $caps = array (); public $cap_key = NULL; public $roles = array (); public $allcaps = array (); public $filter = NULL }, $comment_id = 45, $args = array ('type' => 'comment', 'deliver' => 'asap', 'auto_confirm' => NULL, 'process_events' => TRUE, 'process_list_server' => FALSE, 'user_initiated' => TRUE, 'keep_existing' => TRUE)) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/CommentPost.php:95
PHP   9. WebSharks\CommentMail\SubInjector->maybeInject() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInjector.php:142
PHP  10. WebSharks\CommentMail\SubInserter->__construct($request_args = array ('ID' => NULL, 'key' => NULL, 'user_id' => 0, 'post_id' => '1740', 'comment_id' => '45', 'deliver' => 'asap', 'fname' => 'test2', 'lname' => '', 'email' => 'test@test2.com', 'insertion_ip' => NULL, 'insertion_region' => NULL, 'insertion_country' => NULL, 'last_ip' => NULL, 'last_region' => NULL, 'last_country' => NULL, 'status' => NULL, 'insertion_time' => NULL, 'last_update_time' => NULL), $args = array ('auto_confirm' => NULL, 'process_events' => TRUE, 'process_confirmation' => TRUE, 'process_list_server' => FALSE, 'user_initiated' => TRUE, 'ui_protected_data_keys_enable' => FALSE, 'ui_protected_data_user' => NULL, 'user_allow_0' => NULL, 'keep_existing' => TRUE, 'check_blacklist' => TRUE)) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInjector.php:199
PHP  11. WebSharks\CommentMail\SubInserter->maybeInsertUpdate() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:479
PHP  12. WebSharks\CommentMail\SubInserter->insert() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:695
PHP  13. WebSharks\CommentMail\SubInserter->overwriteAnyOthersAfterInsertUpdate() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:766
PHP Notice:  Array to string conversion in /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php on line 1032
PHP Stack trace:
PHP   1. {main}() /srv/www/wordpress-default/wp-comments-post.php:0
PHP   2. wp_handle_comment_submission($comment_data = array ('comment' => 'test!!', 'author' => 'test2', 'email' => 'test@test2.com', 'url' => '', 'comment_mail_sub_type' => 'comment', 'comment_mail_sub_deliver' => 'asap', 'submit' => 'Submit Comment', 'comment_post_ID' => '1740', 'comment_parent' => '0')) /srv/www/wordpress-default/wp-comments-post.php:20
PHP   3. wp_new_comment($commentdata = array ('comment_post_ID' => 1740, 'comment_author' => 'test2', 'comment_author_email' => 'test@test2.com', 'comment_author_url' => '', 'comment_content' => 'test!!', 'comment_type' => '', 'comment_parent' => 0, 'comment_author_IP' => '192.168.50.1', 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36', 'comment_date' => '2016-06-08 11:55:21', 'comment_date_gmt' => '2016-06-08 15:55:21', 'filtered' => TRUE, 'comment_approved' => 1)) /srv/www/wordpress-default/wp-includes/comment.php:2918
PHP   4. do_action($tag = 'comment_post', $arg = 45, 1, array ('comment_post_ID' => 1740, 'comment_author' => 'test2', 'comment_author_email' => 'test@test2.com', 'comment_author_url' => '', 'comment_content' => 'test!!', 'comment_type' => '', 'comment_parent' => 0, 'comment_author_IP' => '192.168.50.1', 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36', 'comment_date' => '2016-06-08 11:55:21', 'comment_date_gmt' => '2016-06-08 15:55:21', 'filtered' => TRUE, 'comment_approved' => 1)) /srv/www/wordpress-default/wp-includes/comment.php:1821
PHP   5. WebSharks\CommentMail\Plugin->commentPost($comment_id = 45, $comment_status = 1) /srv/www/wordpress-default/wp-includes/plugin.php:525
PHP   6. WebSharks\CommentMail\CommentPost->__construct($comment_id = 45, $comment_status = 1) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/Plugin.php:2403
PHP   7. WebSharks\CommentMail\CommentPost->maybeInjectSub() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/CommentPost.php:54
PHP   8. WebSharks\CommentMail\SubInjector->__construct($user = class WP_User { public $data = class stdClass {  }; public $ID = 0; public $caps = array (); public $cap_key = NULL; public $roles = array (); public $allcaps = array (); public $filter = NULL }, $comment_id = 45, $args = array ('type' => 'comment', 'deliver' => 'asap', 'auto_confirm' => NULL, 'process_events' => TRUE, 'process_list_server' => FALSE, 'user_initiated' => TRUE, 'keep_existing' => TRUE)) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/CommentPost.php:95
PHP   9. WebSharks\CommentMail\SubInjector->maybeInject() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInjector.php:142
PHP  10. WebSharks\CommentMail\SubInserter->__construct($request_args = array ('ID' => NULL, 'key' => NULL, 'user_id' => 0, 'post_id' => '1740', 'comment_id' => '45', 'deliver' => 'asap', 'fname' => 'test2', 'lname' => '', 'email' => 'test@test2.com', 'insertion_ip' => NULL, 'insertion_region' => NULL, 'insertion_country' => NULL, 'last_ip' => NULL, 'last_region' => NULL, 'last_country' => NULL, 'status' => NULL, 'insertion_time' => NULL, 'last_update_time' => NULL), $args = array ('auto_confirm' => NULL, 'process_events' => TRUE, 'process_confirmation' => TRUE, 'process_list_server' => FALSE, 'user_initiated' => TRUE, 'ui_protected_data_keys_enable' => FALSE, 'ui_protected_data_user' => NULL, 'user_allow_0' => NULL, 'keep_existing' => TRUE, 'check_blacklist' => TRUE)) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInjector.php:199
PHP  11. WebSharks\CommentMail\SubInserter->maybeInsertUpdate() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:479
PHP  12. WebSharks\CommentMail\SubInserter->insert() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:695
PHP  13. WebSharks\CommentMail\SubInserter->overwriteAnyOthersAfterInsertUpdate() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:766
PHP Notice:  Array to string conversion in /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php on line 1033
PHP Stack trace:
PHP   1. {main}() /srv/www/wordpress-default/wp-comments-post.php:0
PHP   2. wp_handle_comment_submission($comment_data = array ('comment' => 'test!!', 'author' => 'test2', 'email' => 'test@test2.com', 'url' => '', 'comment_mail_sub_type' => 'comment', 'comment_mail_sub_deliver' => 'asap', 'submit' => 'Submit Comment', 'comment_post_ID' => '1740', 'comment_parent' => '0')) /srv/www/wordpress-default/wp-comments-post.php:20
PHP   3. wp_new_comment($commentdata = array ('comment_post_ID' => 1740, 'comment_author' => 'test2', 'comment_author_email' => 'test@test2.com', 'comment_author_url' => '', 'comment_content' => 'test!!', 'comment_type' => '', 'comment_parent' => 0, 'comment_author_IP' => '192.168.50.1', 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36', 'comment_date' => '2016-06-08 11:55:21', 'comment_date_gmt' => '2016-06-08 15:55:21', 'filtered' => TRUE, 'comment_approved' => 1)) /srv/www/wordpress-default/wp-includes/comment.php:2918
PHP   4. do_action($tag = 'comment_post', $arg = 45, 1, array ('comment_post_ID' => 1740, 'comment_author' => 'test2', 'comment_author_email' => 'test@test2.com', 'comment_author_url' => '', 'comment_content' => 'test!!', 'comment_type' => '', 'comment_parent' => 0, 'comment_author_IP' => '192.168.50.1', 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36', 'comment_date' => '2016-06-08 11:55:21', 'comment_date_gmt' => '2016-06-08 15:55:21', 'filtered' => TRUE, 'comment_approved' => 1)) /srv/www/wordpress-default/wp-includes/comment.php:1821
PHP   5. WebSharks\CommentMail\Plugin->commentPost($comment_id = 45, $comment_status = 1) /srv/www/wordpress-default/wp-includes/plugin.php:525
PHP   6. WebSharks\CommentMail\CommentPost->__construct($comment_id = 45, $comment_status = 1) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/Plugin.php:2403
PHP   7. WebSharks\CommentMail\CommentPost->maybeInjectSub() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/CommentPost.php:54
PHP   8. WebSharks\CommentMail\SubInjector->__construct($user = class WP_User { public $data = class stdClass {  }; public $ID = 0; public $caps = array (); public $cap_key = NULL; public $roles = array (); public $allcaps = array (); public $filter = NULL }, $comment_id = 45, $args = array ('type' => 'comment', 'deliver' => 'asap', 'auto_confirm' => NULL, 'process_events' => TRUE, 'process_list_server' => FALSE, 'user_initiated' => TRUE, 'keep_existing' => TRUE)) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/CommentPost.php:95
PHP   9. WebSharks\CommentMail\SubInjector->maybeInject() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInjector.php:142
PHP  10. WebSharks\CommentMail\SubInserter->__construct($request_args = array ('ID' => NULL, 'key' => NULL, 'user_id' => 0, 'post_id' => '1740', 'comment_id' => '45', 'deliver' => 'asap', 'fname' => 'test2', 'lname' => '', 'email' => 'test@test2.com', 'insertion_ip' => NULL, 'insertion_region' => NULL, 'insertion_country' => NULL, 'last_ip' => NULL, 'last_region' => NULL, 'last_country' => NULL, 'status' => NULL, 'insertion_time' => NULL, 'last_update_time' => NULL), $args = array ('auto_confirm' => NULL, 'process_events' => TRUE, 'process_confirmation' => TRUE, 'process_list_server' => FALSE, 'user_initiated' => TRUE, 'ui_protected_data_keys_enable' => FALSE, 'ui_protected_data_user' => NULL, 'user_allow_0' => NULL, 'keep_existing' => TRUE, 'check_blacklist' => TRUE)) /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInjector.php:199
PHP  11. WebSharks\CommentMail\SubInserter->maybeInsertUpdate() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:479
PHP  12. WebSharks\CommentMail\SubInserter->insert() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:695
PHP  13. WebSharks\CommentMail\SubInserter->overwriteAnyOthersAfterInsertUpdate() /srv/www/wordpress-default/wp-content/plugins/comment-mail/src/includes/classes/SubInserter.php:766

Errors testing latest public release (v160215):

Notice: Array to string conversion in /srv/www/wordpress-default/wp-content/plugins/comment-mail-pro/src/includes/classes/SubInserter.php on line 1026
Call Stack
#   Time    Memory  Function    Location
1   0.2021  363976  {main}( )   .../wp-comments-post.php:0
2   0.3216  2765200 wp_handle_comment_submission( array(9) )    .../wp-comments-post.php:20
3   0.3230  2468400 wp_new_comment( array(13) ) .../comment.php:2918
4   0.3294  2483192 do_action( string(12), long, long, array(13) )  .../comment.php:1821
5   1.0258  2619664 WebSharks\CommentMail\Pro\Plugin->commentPost( long, long ) .../plugin.php:525
6   1.0286  2621536 WebSharks\CommentMail\Pro\CommentPost->__construct( long, long )    .../Plugin.php:2536
7   1.0315  2624280 WebSharks\CommentMail\Pro\CommentPost->maybeInjectSub( )    .../CommentPost.php:54
8   1.0345  2630776 WebSharks\CommentMail\Pro\SubInjector->__construct( object(WP_User)[352], long, array(7) )  .../CommentPost.php:95
9   1.0365  2634408 WebSharks\CommentMail\Pro\SubInjector->maybeInject( )   .../SubInjector.php:142
10  1.0387  2640200 WebSharks\CommentMail\Pro\SubInserter->__construct( array(18), array(10) )  .../SubInjector.php:199
11  1.0392  2641120 WebSharks\CommentMail\Pro\SubInserter->maybeInsertUpdate( ) .../SubInserter.php:479
12  1.0432  2649296 WebSharks\CommentMail\Pro\SubInserter->insert( )    .../SubInserter.php:695
13  1.0525  2800536 WebSharks\CommentMail\Pro\SubInserter->overwriteAnyOthersAfterInsertUpdate( )   .../SubInserter.php:766

( ! ) Notice: Array to string conversion in /srv/www/wordpress-default/wp-content/plugins/comment-mail-pro/src/includes/classes/SubInserter.php on line 1029
Call Stack
#   Time    Memory  Function    Location
1   0.2021  363976  {main}( )   .../wp-comments-post.php:0
2   0.3216  2765200 wp_handle_comment_submission( array(9) )    .../wp-comments-post.php:20
3   0.3230  2468400 wp_new_comment( array(13) ) .../comment.php:2918
4   0.3294  2483192 do_action( string(12), long, long, array(13) )  .../comment.php:1821
5   1.0258  2619664 WebSharks\CommentMail\Pro\Plugin->commentPost( long, long ) .../plugin.php:525
6   1.0286  2621536 WebSharks\CommentMail\Pro\CommentPost->__construct( long, long )    .../Plugin.php:2536
7   1.0315  2624280 WebSharks\CommentMail\Pro\CommentPost->maybeInjectSub( )    .../CommentPost.php:54
8   1.0345  2630776 WebSharks\CommentMail\Pro\SubInjector->__construct( object(WP_User)[352], long, array(7) )  .../CommentPost.php:95
9   1.0365  2634408 WebSharks\CommentMail\Pro\SubInjector->maybeInject( )   .../SubInjector.php:142
10  1.0387  2640200 WebSharks\CommentMail\Pro\SubInserter->__construct( array(18), array(10) )  .../SubInjector.php:199
11  1.0392  2641120 WebSharks\CommentMail\Pro\SubInserter->maybeInsertUpdate( ) .../SubInserter.php:479
12  1.0432  2649296 WebSharks\CommentMail\Pro\SubInserter->insert( )    .../SubInserter.php:695
13  1.0525  2800536 WebSharks\CommentMail\Pro\SubInserter->overwriteAnyOthersAfterInsertUpdate( )   .../SubInserter.php:766

( ! ) Notice: Array to string conversion in /srv/www/wordpress-default/wp-content/plugins/comment-mail-pro/src/includes/classes/SubInserter.php on line 1032
Call Stack
#   Time    Memory  Function    Location
1   0.2021  363976  {main}( )   .../wp-comments-post.php:0
2   0.3216  2765200 wp_handle_comment_submission( array(9) )    .../wp-comments-post.php:20
3   0.3230  2468400 wp_new_comment( array(13) ) .../comment.php:2918
4   0.3294  2483192 do_action( string(12), long, long, array(13) )  .../comment.php:1821
5   1.0258  2619664 WebSharks\CommentMail\Pro\Plugin->commentPost( long, long ) .../plugin.php:525
6   1.0286  2621536 WebSharks\CommentMail\Pro\CommentPost->__construct( long, long )    .../Plugin.php:2536
7   1.0315  2624280 WebSharks\CommentMail\Pro\CommentPost->maybeInjectSub( )    .../CommentPost.php:54
8   1.0345  2630776 WebSharks\CommentMail\Pro\SubInjector->__construct( object(WP_User)[352], long, array(7) )  .../CommentPost.php:95
9   1.0365  2634408 WebSharks\CommentMail\Pro\SubInjector->maybeInject( )   .../SubInjector.php:142
10  1.0387  2640200 WebSharks\CommentMail\Pro\SubInserter->__construct( array(18), array(10) )  .../SubInjector.php:199
11  1.0392  2641120 WebSharks\CommentMail\Pro\SubInserter->maybeInsertUpdate( ) .../SubInserter.php:479
12  1.0432  2649296 WebSharks\CommentMail\Pro\SubInserter->insert( )    .../SubInserter.php:695
13  1.0525  2800536 WebSharks\CommentMail\Pro\SubInserter->overwriteAnyOthersAfterInsertUpdate( )   .../SubInserter.php:766

( ! ) Notice: Array to string conversion in /srv/www/wordpress-default/wp-content/plugins/comment-mail-pro/src/includes/classes/SubInserter.php on line 1033
Call Stack
#   Time    Memory  Function    Location
1   0.2021  363976  {main}( )   .../wp-comments-post.php:0
2   0.3216  2765200 wp_handle_comment_submission( array(9) )    .../wp-comments-post.php:20
3   0.3230  2468400 wp_new_comment( array(13) ) .../comment.php:2918
4   0.3294  2483192 do_action( string(12), long, long, array(13) )  .../comment.php:1821
5   1.0258  2619664 WebSharks\CommentMail\Pro\Plugin->commentPost( long, long ) .../plugin.php:525
6   1.0286  2621536 WebSharks\CommentMail\Pro\CommentPost->__construct( long, long )    .../Plugin.php:2536
7   1.0315  2624280 WebSharks\CommentMail\Pro\CommentPost->maybeInjectSub( )    .../CommentPost.php:54
8   1.0345  2630776 WebSharks\CommentMail\Pro\SubInjector->__construct( object(WP_User)[352], long, array(7) )  .../CommentPost.php:95
9   1.0365  2634408 WebSharks\CommentMail\Pro\SubInjector->maybeInject( )   .../SubInjector.php:142
10  1.0387  2640200 WebSharks\CommentMail\Pro\SubInserter->__construct( array(18), array(10) )  .../SubInjector.php:199
11  1.0392  2641120 WebSharks\CommentMail\Pro\SubInserter->maybeInsertUpdate( ) .../SubInserter.php:479
12  1.0432  2649296 WebSharks\CommentMail\Pro\SubInserter->insert( )    .../SubInserter.php:695
13  1.0525  2800536 WebSharks\CommentMail\Pro\SubInserter->overwriteAnyOthersAfterInsertUpdate( )   .../SubInserter.php:766

Related: #298

@raamdev raamdev added this to the Next Release milestone Jun 2, 2016

@raamdev

This comment has been minimized.

Contributor

raamdev commented Jun 8, 2016

Here's L1026 on the dev branch that's throwing the Array to string conversion notice:
https://github.com/websharks/comment-mail-pro/blob/000000-dev/src/includes/classes/SubInserter.php#L1026

It looks like $this->sub->post_id is an Array for some reason, but probably shouldn't be.

@raamdev

This comment has been minimized.

Contributor

raamdev commented Jun 8, 2016

Confirmed via XDebug that $this->sub->post_id is an Array:

2016-06-08_12-16-51

@raamdev

This comment has been minimized.

Contributor

raamdev commented Jun 8, 2016

It looks like this line that calls SubEventLogInserter is modifying $this->sub->post_id and turning it into an array.

@raamdev

This comment has been minimized.

Contributor

raamdev commented Jun 8, 2016

The SubEventLogInserter is calling the following:

$this->plugin->utils_db->wp->insert($this->plugin->utils_db->prefix().'sub_event_log', $this->entry)

That eventually calls the WordPress process_fields() function with the data (i.e., $this->entry aka $this->sub), which is resulting in the data in $this->sub being modified unexpectedly.

So it sounds like this line should be passing a copy of $this->sub to the SubEventLogInserter, so that we don't end up with unexpected data.

@jaswsinc do you agree?

@jaswrks

This comment has been minimized.

Member

jaswrks commented Jun 8, 2016

Yes. I agree. You found a PHP 🐛 it looks like! :-)

@raamdev raamdev self-assigned this Jun 8, 2016

@raamdev

This comment has been minimized.

Contributor

raamdev commented Jun 8, 2016

Confirmed that this issue does not occur with PHP 5.5. I'm marking this a php bug and moving this issue to the Future Release milestone. PHP7 support is not a top priority at the moment (getting the next release out is a top priority, as its been 4 months since the last release).

@raamdev raamdev modified the milestones: Future Release, Next Release Jun 8, 2016

@raamdev raamdev added php bug and removed bug labels Jun 8, 2016

@raamdev

This comment has been minimized.

Contributor

raamdev commented Jun 14, 2016

Noting that this issue also affects the StCR importer.

2016-06-14_10-23-07

@raamdev raamdev changed the title from Notice: Array to string conversion to PHP 7: Notice: Array to string conversion Jun 14, 2016

@raamdev

This comment has been minimized.

Contributor

raamdev commented Jun 16, 2016

Marking this as a high-priority issue to solve one the current release cycle finishes. As it stands, Comment Mail is unusable on PHP 7, so we either need to detect sites running PHP 7 and provide a Dashboard notice, or fix the underlying issue so that it's not an issue.

@jaswrks

This comment has been minimized.

Member

jaswrks commented Oct 11, 2016

Objective: Confirm via XDebug that this does not impact prior versions of PHP and also test against the latest release of PHP v7.0.x and 7.1 to see if the problem has been solved; assuming it is in fact a PHP v7. x bug. ~ Estimate at 1 day.

@raamdev raamdev assigned jaswrks and unassigned raamdev Oct 11, 2016

@jaswrks

This comment has been minimized.

Member

jaswrks commented Nov 2, 2016

Referencing the origin of the unexpected array of data noted above.
https://github.com/WordPress/WordPress/blob/4.6.1/wp-includes/wp-db.php#L2161-L2215

jaswrks pushed a commit to websharks/comment-mail-pro that referenced this issue Nov 2, 2016

jaswsinc

@jaswrks jaswrks referenced this issue Nov 2, 2016

Merged

Feature/272 #86

@jaswrks

This comment has been minimized.

Member

jaswrks commented Nov 2, 2016

Confirmed this is in fact a PHP 7 bug.

  • Does NOT occur in PHP 5.6.
  • Does occur in PHP 7.0.4.
  • Does occur in PHP 7.0.6.
  • Does occur in PHP 7.0.7.
  • Does occur in PHP 7.0.8.
  • Does NOT occur in PHP 7.0.9.
  • Does NOT occur in PHP 7.0.10.
  • Have not yet tested in PHP 7.1 RC, but I will assume the bug does not exist there.

This bug appears to have been corrected in PHP 7.0.9.
https://bugs.php.net/bug.php?id=72508

And then another related bug was corrected in PHP 7.0.10.
https://bugs.php.net/bug.php?id=72622

Also referencing: http://php.net/ChangeLog-7.php


Conclusion: Comment Mail requires PHP 5.4.x+, or when upgrading to PHP 7, requires PHP 7.0.9+ with PHP 7.0.10 being suggested as it includes some additional bug fixes that are indirectly related to a problem with PHP internals creating references inadvertently.

@jaswrks

This comment has been minimized.

Member

jaswrks commented Nov 2, 2016

Next Release Changelog:

  • PHP v7 Compatibility: After further testing, it was found that while Comment Mail is compatible with PHP v7.0, you must be running PHP v7.0.9+. Starting with this release of Comment Mail if you're running PHP v7 < 7.0.9 a warning is displayed in the WordPress Dashboard asking the site owner to upgrade to PHP v7.0.9 or higher. Note: While PHP v7.0.9 is adequate, PHP v7.0.10 is strongly recommended. See also: issue #272 for further details.

2016-11-02_07-26-31

@jaswrks jaswrks closed this Nov 2, 2016

@jaswrks jaswrks reopened this Nov 2, 2016

@jaswrks

This comment has been minimized.

Member

jaswrks commented Nov 2, 2016

This issue can be closed by @raamdev once a review is complete.

@raamdev

This comment has been minimized.

Contributor

raamdev commented Nov 3, 2016

@jaswsinc Awesome! Glad we got to the bottom of that issue. In your screenshot, that notice is dismissable, but IMO that notice should be persistent, since a site owner could inadvertently dismiss it and might then wonder why Comment Mail isn't working as expected. Comment Mail is truly broken (notifications don't get sent) when running PHP 7 < 7.0.9, so I think a persistent notice is applicable here.

@jaswrks

This comment has been minimized.

Member

jaswrks commented Nov 3, 2016

Agree. I'm opening a fork in #308

@raamdev raamdev closed this Nov 3, 2016

jaswrks pushed a commit to websharks/comment-mail-pro that referenced this issue Nov 4, 2016

jaswsinc
@jaswrks

This comment has been minimized.

Member

jaswrks commented Nov 4, 2016

No longer dismissable. Fixed in #308

@raamdev raamdev removed the ready for work label Nov 9, 2016

@raamdev raamdev reopened this Nov 9, 2016

@raamdev raamdev assigned renzms and unassigned jaswrks Nov 10, 2016

raamdev added a commit that referenced this issue Nov 18, 2016

Phing release of v161118 with the following changes:
- **Bug Fix:** Exclude unapproved comments from the dropdown menu on the 'Subscribe Without Commenting' form. See [Issue #299](#299).
- **Enhancement:** When parsing templates, this release uses `include()` instead of `eval()` whenever possible. This improves compatibility with shared hosting providers and makes it easier to debug template parsing issues should they occur. See [Issue #192](#192).
- **PHP v7 Compatibility:** After further testing, it was found that while Comment Mail is compatible with PHP v7.0, you must be running PHP v7.0.9+. Starting with this release of Comment Mail if you're running PHP v7 < 7.0.9 a warning is displayed in the WordPress Dashboard asking the site owner to upgrade to PHP v7.0.9 or higher. Note: While PHP v7.0.9 is adequate, PHP v7.0.10 is strongly recommended. See [Issue #272](#272).
- **New SparkPost Integration** (Pro):  It is now possible to use SparkPost for Replies-via-Email (RVE) instead of Mandrill. Note that SparkPost is now the suggested RVE Handler for Comment Mail because Mandrill changed its pricing structure a while back. In short, Mandrill requires a fee, whereas SparkPost (recommended) offers Relay Webhooks as a part of their free plan. See [Issue #265](#265).
- **New Feature** (Pro): Adding support for MailChimp integration. It is now possible to give users the option of subscribing to your site-wide mailing list whenever they leave a comment or reply; i.e., in addition to subscribing to comment reply notifications they can also join your MailChimp mailing list. See [Issue #114](#114).
@raamdev

This comment has been minimized.

Contributor

raamdev commented Nov 18, 2016

Comment Mail v161118 has been released and includes changes from this GitHub Issue. See the v161118 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#272).

@raamdev raamdev closed this Nov 18, 2016

@websharks websharks locked and limited conversation to collaborators Nov 18, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.