• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

Solved Comment error in XF1

robru

Baby Penguin
XenWord Professional
PHP:
Error: Class 'XenWord' not found - /var/www/html/wp-content/plugins/xenword-2017.10.25/legacy/includes/Comments/class-xenword-comments.php:74
Generated By: Unknown Account, Today at 5:39 AM
PHP:
#0 /var/www/html/wp-content/plugins/xenword-2017.10.25/legacy/includes/Comments/Display.php(48): XenWord_Comments::useXenForoCommentHandler()
#1 /var/www/html/wp-includes/class-wp-hook.php(298): Display->BuildCommentsArray('/var/www/html/w...')
#2 /var/www/html/wp-includes/plugin.php(203): WP_Hook->apply_filters('/var/www/html/w...', Array)
#3 /var/www/html/wp-includes/comment-template.php(1469): apply_filters('comments_templa...', '/var/www/html/w...')
#4 /var/www/html/wp-content/themes/Newspaper/single_template_1.php(29): comments_template('/comments.php', true)
#5 /var/www/html/wp-includes/template-loader.php(74): include('/var/www/html/w...')
#6 /var/www/html/wp-blog-header.php(19): require_once('/var/www/html/w...')
#7 /var/www/html/index.php(17): require('/var/www/html/w...')
#8 {main}

Also see:

https://www.tuxreports.com/community/threads/activating-xenword-pro-2017.610677/#post-1944071
https://www.tuxreports.com/community/threads/activating-xenword-pro-2017.610677/#post-1944072
 

robru

Baby Penguin
XenWord Professional
Found that last night. Change line 74 in the file from XenWord:: to XenWord_Connector::
Original text in: /var/www/html/wp-content/plugins/xenword-2017.10.25/legacy/includes/Comments/class-xenword-comments.php

What you want to change is already in place ;)

PHP:
} elseif ( isset( $wp_query->post->ID ) ) {
            if ( XenWord_Connector::getThreadIdForPost( $wp_query->post->ID ) != '0' || XenWord::getThreadIdForPost( $wp_query->post->ID ) != '' ) {
                return true;
            } else {
                return false;
            }
        }
 

LPH

Flight Director
Flight Instructor
It’s the second one in the line 2 of your post. It’s after the ||

PHP:
} elseif ( isset( $wp_query->post->ID ) ) {
            if ( XenWord_Connector::getThreadIdForPost( $wp_query->post->ID ) != '0' || XenWord_Connector::getThreadIdForPost( $wp_query->post->ID ) != '' ) {
                return true;
            } else {
                return false;
            }
        }
 

robru

Baby Penguin
XenWord Professional
No errors anymore in admincp XF1 but comments stay closed.
I can only say that the comments worked well in version 3.4.3.0 ;)
Schermafbeelding 2017-10-26 om 22.52.15.png
 
Last edited:

LPH

Flight Director
Flight Instructor

Sorry that I missed that line but now I can see how poorly written it is and will fix the logic in the next release.
omments stay closed

I just arrived home and need to work on a few items then I'll take a look. The code was only changed for the connector so maybe a bug was uncovered.
 

LPH

Flight Director
Flight Instructor
The comments closed is something new. It happened after renaming the XenWord class to XenWord_Connector. A hidden bug has reared its ugly head. I'm reading through the code to figure out what went wrong - since only the class name was changed.
 

LPH

Flight Director
Flight Instructor
This is extremely strange. The dump of $post shows the comment_status is open but the display is comments are closed. I'll keep searching for what is happening.

Comments Are Closed.png
 

LPH

Flight Director
Flight Instructor
Smack me silly. The same mistake.

Open class-xenword-users-banned.php
Go to line 30
Replace with the following

PHP:
if (class_exists('XenWord_Connector')) {

Notice, once again, I didn't change the XenWord to XenWord_Connector.

Sigh.

This is fixed in XenWord Pro 2017.10.26
 
Top