Title: comment_ID Error
Last modified: July 25, 2024

---

# comment_ID Error

 *  [geekcohen](https://wordpress.org/support/users/geekcohen/)
 * (@geekcohen)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/comment_id-error/)
 * Similar to [https://wordpress.org/support/topic/php-warnings-168/](https://wordpress.org/support/topic/php-warnings-168/)
   I am getting a PHP error
 * `[25-Jul-2024 19:56:58 UTC] PHP Notice: Trying to get property 'comment_ID' of
   non-object in /wp-content/plugins/urvanov-syntax-highlighter/class-urvanov-syntax-
   highlighter-plugin.php on line 743
   [25-Jul-2024 19:56:58 UTC] PHP Notice: Trying
   to get property 'comment_ID' of non-object in wp-content/plugins/urvanov-syntax-
   highlighter/class-urvanov-syntax-highlighter-plugin.php on line 753
 * Plugin Version 2.8.36
 * PHP Version 7.4.33
 * WordPress 6.6.1
 * Looks to be related to these two functions:
 *     ```wp-block-code
       public static function pre_comment_text($text, $comment, $args ) {        $comment_id = strval($comment->comment_ID);        if (array_key_exists($comment_id, self::$comment_captures)) {            // Replace with IDs now that we need to            $text = self::$comment_captures[$comment_id];        }        return $text;    }    public static function comment_text($text) {        global $comment;        $comment_id = strval($comment->comment_ID);        // Find if this post has Crayons        if (array_key_exists($comment_id, self::$comment_queue)) {            // XXX We want the plain post content, no formatting            $the_content_original = $text;            // Loop through Crayons            $post_in_queue = self::$comment_queue[$comment_id];            foreach ($post_in_queue as $id => $v) {                $atts = $v['atts'];                $content = $v['code']; // The code we replace post content with                $crayon = self::shortcode($atts, $content, $id);                $crayon_formatted = $crayon->output(TRUE, FALSE);                // Replacing may cause <p> tags to become disjoint with a <div> inside them, close and reopen them if needed                if (!$crayon->is_inline()) {                    $text = preg_replace_callback('#' . self::REGEX_BETWEEN_PARAGRAPH_SIMPLE . '#msi', 'Urvanov_Syntax_Highlighter_Plugin::add_paragraphs', $text);                }                // Replace the code with the Crayon                $text = UrvanovSyntaxHighlighterUtil::preg_replace_escape_back(self::regex_with_id($id), $crayon_formatted, $text, 1, $text);            }        }        return $text;    }
       ```
   

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

 *  Plugin Author [urvanov](https://wordpress.org/support/users/urvanov/)
 * (@urvanov)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/comment_id-error/#post-17916193)
 * Thank you for reporting. I will try to investigate this problem.
 * I thought I fixed it last time.
 *  Thread Starter [geekcohen](https://wordpress.org/support/users/geekcohen/)
 * (@geekcohen)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/comment_id-error/#post-17916209)
 * That would be great, thank you.
 *  Plugin Author [urvanov](https://wordpress.org/support/users/urvanov/)
 * (@urvanov)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/comment_id-error/#post-17928758)
 * Fixed in 2.8.37. I hope.
 *  Thread Starter [geekcohen](https://wordpress.org/support/users/geekcohen/)
 * (@geekcohen)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/comment_id-error/#post-17932919)
 * New error, not sure if it is our end or not, but comes up.
 * `[05-Aug-2024 04:09:05 UTC] PHP Notice: Trying to get property 'ID' of non-object
   in /home/xxxx/public_html/wp-content/plugins/urvanov-syntax-highlighter/class-
   urvanov-syntax-highlighter-plugin.php on line 696`

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

The topic ‘comment_ID Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/urvanov-syntax-highlighter.svg)
 * [Urvanov Syntax Highlighter](https://wordpress.org/plugins/urvanov-syntax-highlighter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/urvanov-syntax-highlighter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/urvanov-syntax-highlighter/)
 * [Active Topics](https://wordpress.org/support/plugin/urvanov-syntax-highlighter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/urvanov-syntax-highlighter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/urvanov-syntax-highlighter/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [geekcohen](https://wordpress.org/support/users/geekcohen/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/comment_id-error/#post-17932919)
 * Status: not resolved