Title: Additional Misc PHP Errors: Undefined index&#8230;
Last modified: September 12, 2017

---

# Additional Misc PHP Errors: Undefined index…

 *  [rsm-support](https://wordpress.org/support/users/rsm-support/)
 * (@rsm-support)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/additional-misc-php-errors-undefined-index/)
 * We run WP_DEBUG in logging mode. PHP 7.0.
 * The following PHP errors (NOTICE level, but still an error) show up regularly
   in the logs:
 *     ```
       PHP Notice:  Undefined index: comment_post_ID in {DOCUMENT_ROOT}/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1270
       PHP Notice:  Undefined index: delete_all in {DOCUMENT_ROOT}/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1300
       PHP Notice:  Undefined index: delete_all2 in {DOCUMENT_ROOT}/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1300
       ```
   
 * It’s an easy fix.
 * Change line 1270 from
 *     ```
       $postid = $comment['comment_post_ID'];
       ```
   
 * to
 *     ```
       $postid = ( !empty( $comment['comment_post_ID'] ) ) ? $comment['comment_post_ID'] : '';
       ```
   
 * Change line 1300 from
 *     ```
       } elseif ( $_GET[ 'delete_all' ] != 'Empty Trash' && $_GET[ 'delete_all2' ] != 'Empty Spam' ) {
       ```
   
 * to
 *     ```
       } elseif ( isset( $_GET['delete_all'], $_GET['delete_all2'] ) && $_GET['delete_all'] !== 'Empty Trash' && $_GET['delete_all2'] !== 'Empty Spam' ) {
       ```
   
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Saša](https://wordpress.org/support/users/stodorovic/)
 * (@stodorovic)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/additional-misc-php-errors-undefined-index/#post-9496816)
 * Hi [@rsm-support](https://wordpress.org/support/users/rsm-support/)
 * I’ve enabled Xdebug and wp-super-cache debug log on couple website. I figured
   out more details related to these warnings.
 * I created issue [https://github.com/Automattic/wp-super-cache/issues/385](https://github.com/Automattic/wp-super-cache/issues/385)
   and PR [https://github.com/Automattic/wp-super-cache/pull/386](https://github.com/Automattic/wp-super-cache/pull/386).
   Can you look it and send me feedback?
 * Thanks,
    Sasa
 *  Thread Starter [rsm-support](https://wordpress.org/support/users/rsm-support/)
 * (@rsm-support)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/additional-misc-php-errors-undefined-index/#post-9497878)
 * [@stodorovic](https://wordpress.org/support/users/stodorovic/),
 * Have you enabled WP_DEBUG? If not, you should enable that (in [logging-only mode](https://www.redsandmarketing.com/wordpress-guides/debugging/?wpdg=wp_debug#wpdg_wp_debug))
   as well, as you’ll still miss some things.
 * We’ll check out the GitHub issue, and see if we can provide any additional insight.
 *  [Saša](https://wordpress.org/support/users/stodorovic/)
 * (@stodorovic)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/additional-misc-php-errors-undefined-index/#post-9497946)
 * I’ve already enabled `WP_DEBUG` and `WP_DEBUG_LOG` + Xdebug for additional information(
   stack trace and dumping some variables). I think that’s issue when wp_delete_comment
   is executed from wp_delete_post (in this case, other hook will purge post cache).
   
   So, `$GLOBALS[ 'pagenow' ] === 'edit-comments.php'` should limit this code only
   for manual editing/removing comments (WP Dashboard).
 * PS. I just figured out that isn’t good. We should use condition `$GLOBALS[ 'pagenow']
   === 'edit-comments.php' && ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['
   delete_all2'] )` to prevent executing `wp_cache_post_change`. I’m not sure for
   details. I’ll check and update github.
    -  This reply was modified 8 years, 8 months ago by [Saša](https://wordpress.org/support/users/stodorovic/).
    -  This reply was modified 8 years, 8 months ago by [Saša](https://wordpress.org/support/users/stodorovic/).
    -  This reply was modified 8 years, 8 months ago by [Saša](https://wordpress.org/support/users/stodorovic/).
 *  [Saša](https://wordpress.org/support/users/stodorovic/)
 * (@stodorovic)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/additional-misc-php-errors-undefined-index/#post-9501158)
 * [@rsm-support](https://wordpress.org/support/users/rsm-support/)
 * I updated [https://github.com/Automattic/wp-super-cache/pull/386](https://github.com/Automattic/wp-super-cache/pull/386).
   It seems as acceptable solution now, but it seems that we need to improve function`
   wp_cache_get_postid_from_comment` in the future.
 * Sasa

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Additional Misc PHP Errors: Undefined index…’ is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

## Tags

 * [PHP errors](https://wordpress.org/support/topic-tag/php-errors/)
 * [undefined index](https://wordpress.org/support/topic-tag/undefined-index/)

 * 4 replies
 * 2 participants
 * Last reply from: [Saša](https://wordpress.org/support/users/stodorovic/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/additional-misc-php-errors-undefined-index/#post-9501158)
 * Status: not resolved