XF 1.5 Unable to Like Profile Post Comments

The Sandman

Well-known member
Upgraded to XF 1.5 Beta without first uninstalling Nobita's Comment Like add-on. Initially caused some server errors but after running some queries to create the missing colums in the xf_profile_post_comment table and uninstalling the add-on the errors stopped. However, it's not possible to Like any Profile Post Comments now - the Like link is visible and when clicked it does a javascript thingy briefly but does not register the like - the Like link remains. If the comment already had a like before the upgrade, clicking the Like link makes the existing like vanish, but it returns when you refresh the page.

Disabling all listeners in config.php doesn't help, nor does disabling all add-ons via the AdminCP.

Any thoughts on were the problem might lie?
 
Uninstalling after upgrading is likely removing data that is normally there. You may need to uninstall the add-on before upgrading or make sure you upgrade to a "transition" version of the add-on that knows what it should and shouldn't remove when you uninstall it.
 
Uninstalling after upgrading is likely removing data that is normally there. You may need to uninstall the add-on before upgrading or make sure you upgrade to a "transition" version of the add-on that knows what it should and shouldn't remove when you uninstall it.

I'm not sure I'm understanding your recommendation here. Before uninstalling the add-on, I had to update it to the latest version which is XF 1.5 compatible and which "knows" what it should or shouldn't remove. Before I updated the add-on it wouldn't uninstall. I've since upgraded to two newer versions of XF 1.5 Beta with no change in the inability to Like comments. Short of restoring an old 1.4.8 backup and starting over I'm not sure what to do next.
 
He is saying that you should:

1. Update Nobita's add-on to a version that is aware of XF 1.5 (if exists)
2. Upgrade to 1.5
3. Uninstall Nobita's add-on

And if option 1 doesn't exists then:

1. Uninstall Nobita's add-on.
2. Upgrade to 1.5
 
I think you already did this, but it might have been before uninstalling that add on in which case we don't actually know for sure whether that did do some damage. That said, I would be expecting to see errors if any of these columns didn't exist.

Run each one of these and note which fail and which succeed. They are the same queries I gave you when you first had the problem.

Code:
            ALTER TABLE xf_profile_post_comment
            ADD message_state ENUM('visible', 'moderated', 'deleted') NOT NULL DEFAULT 'visible'

Code:
            ALTER TABLE xf_profile_post_comment
            ADD likes INT UNSIGNED NOT NULL DEFAULT 0

Code:
            ALTER TABLE xf_profile_post_comment
            ADD like_users BLOB NOT NULL

Code:
            ALTER TABLE xf_profile_post_comment
            ADD warning_id INT UNSIGNED NOT NULL DEFAULT 0

Code:
            ALTER TABLE xf_profile_post_comment
            ADD warning_message VARCHAR(255) NOT NULL DEFAULT ''
Of course it's a difficult scenario for us to support fully as there is potentially an add on involved.
 
Last edited:
He is saying that you should:

1. Update Nobita's add-on to a version that is aware of XF 1.5 (if exists)
2. Upgrade to 1.5
3. Uninstall Nobita's add-on

And if option 1 doesn't exists then:

1. Uninstall Nobita's add-on.
2. Upgrade to 1.5
I'm already running 1.5, so upgrading to 1.5 isn't an option.
 
Run each one of these and note which fail and which succeed.

Ran those queries again:
Code:
Database changed
MariaDB [the_admin_zone]> ALTER TABLE xf_profile_post_comment
    ->             ADD message_state ENUM('visible', 'moderated', 'deleted') NOT NULL DEFAULT 'visible';
ERROR 1060 (42S21): Duplicate column name 'message_state'
MariaDB [the_admin_zone]> ALTER TABLE xf_profile_post_comment
    ->             ADD likes INT UNSIGNED NOT NULL DEFAULT 0;
ERROR 1060 (42S21): Duplicate column name 'likes'
MariaDB [the_admin_zone]>  ALTER TABLE xf_profile_post_comment
    ->             ADD like_users BLOB NOT NULL;
ERROR 1060 (42S21): Duplicate column name 'like_users'
MariaDB [the_admin_zone]> ALTER TABLE xf_profile_post_comment
    ->             ADD warning_id INT UNSIGNED NOT NULL DEFAULT 0;
ERROR 1060 (42S21): Duplicate column name 'warning_id'
MariaDB [the_admin_zone]> ALTER TABLE xf_profile_post_comment
    ->             ADD warning_message VARCHAR(255) NOT NULL DEFAULT '';
ERROR 1060 (42S21): Duplicate column name 'warning_message'
MariaDB [the_admin_zone]>
 
What is the output of
Code:
SELECT content_type, addon_id
FROM `xf_content_type`
WHERE content_type = 'profile_post_comment'
and
Code:
SELECT *
FROM `xf_content_type_field`
WHERE content_type = 'profile_post_comment'
Code:
MariaDB [the_admin_zone]> SELECT content_type, addon_id
    -> FROM `xf_content_type`
    -> WHERE content_type = 'profile_post_comment';
+----------------------+--------------------+
| content_type         | addon_id           |
+----------------------+--------------------+
| profile_post_comment | nobita_CommentLike |
+----------------------+--------------------+
1 row in set (0.00 sec)

MariaDB [the_admin_zone]> SELECT *
    -> FROM `xf_content_type_field`
    -> WHERE content_type = 'profile_post_comment';
+----------------------+--------------------------------+---------------------------------------------------+
| content_type         | field_name                     | field_value                                       |
+----------------------+--------------------------------+---------------------------------------------------+
| profile_post_comment | alert_handler_class            | Nobita_CommentLike_AlertHandler_Comment           |
| profile_post_comment | like_handler_class             | Nobita_CommentLike_LikeHandler_Comment            |
| profile_post_comment | moderation_queue_handler_class | XenForo_ModerationQueueHandler_ProfilePostComment |
| profile_post_comment | moderator_log_handler_class    | XenForo_ModeratorLogHandler_ProfilePostComment    |
| profile_post_comment | news_feed_handler_class        | Nobita_CommentLike_NewsFeedHandler_Comment        |
| profile_post_comment | report_handler_class           | XenForo_ReportHandler_ProfilePostComment          |
| profile_post_comment | search_handler_class           | XenForo_Search_DataHandler_ProfilePostComment     |
| profile_post_comment | spam_handler_class             | XenForo_SpamHandler_ProfilePostComment            |
| profile_post_comment | stats_handler_class            | XenForo_StatsHandler_ProfilePostComment           |
| profile_post_comment | warning_handler_class          | XenForo_WarningHandler_ProfilePostComment         |
+----------------------+--------------------------------+---------------------------------------------------+
10 rows in set (0.00 sec)

MariaDB [the_admin_zone]>
 
Good call @batpool52!

This is something that @Nobita.Kun will likely need to rectify in his add-on.

In the meantime, run these:

Code:
DELETE FROM xf_content_type WHERE content_type = 'profile_post_comment'

Code:
DELETE FROM xf_content_type_field WHERE content_type = 'profile_post_comment' AND field_value LIKE 'Nobita_CommentLike%'

Code:
INSERT IGNORE INTO xf_content_type
    (content_type, addon_id, fields)
VALUES
    ('profile_post_comment', 'XenForo', '')

Code:
INSERT IGNORE INTO xf_content_type_field
    (content_type, field_name, field_value)
VALUES
    ('profile_post_comment', 'alert_handler_class', 'XenForo_AlertHandler_ProfilePostComment'),
    ('profile_post_comment', 'like_handler_class', 'XenForo_LikeHandler_ProfilePostComment'),
    ('profile_post_comment', 'news_feed_handler_class', 'XenForo_NewsFeedHandler_ProfilePostComment')

And finally:

Code:
DELETE FROM xf_data_registry WHERE data_key = 'contentTypes'
 
Code:
MariaDB [the_admin_zone]> DELETE FROM xf_content_type WHERE content_type = 'profile_post_comment'
    -> ;
Query OK, 1 row affected (0.00 sec)

MariaDB [the_admin_zone]> DELETE FROM xf_content_type_field WHERE content_type = 'profile_post_comment' AND field_value LIKE 'Nobita_CommentLike%';
Query OK, 3 rows affected (0.00 sec)

MariaDB [the_admin_zone]> INSERT IGNORE INTO xf_content_type
    ->     (content_type, addon_id, fields)
    -> VALUES
    ->     ('profile_post_comment', 'XenForo', '');
Query OK, 1 row affected (0.00 sec)

MariaDB [the_admin_zone]> INSERT IGNORE INTO xf_content_type_field
    ->     (content_type, field_name, field_value)
    -> VALUES
    ->     ('profile_post_comment', 'alert_handler_class', 'XenForo_AlertHandler_ProfilePostComment'),
    ->     ('profile_post_comment', 'like_handler_class', 'XenForo_LikeHandler_ProfilePostComment'),
    ->     ('profile_post_comment', 'news_feed_handler_class', 'XenForo_NewsFeedHandler_ProfilePostComment');
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

MariaDB [the_admin_zone]>
 
Good call @batpool52!

This is something that @Nobita.Kun will likely need to rectify in his add-on.

In the meantime, run these:

Code:
DELETE FROM xf_content_type WHERE content_type = 'profile_post_comment'

Code:
DELETE FROM xf_content_type_field WHERE content_type = 'profile_post_comment' AND field_value LIKE 'Nobita_CommentLike%'

Code:
INSERT IGNORE INTO xf_content_type
    (content_type, addon_id, fields)
VALUES
    ('profile_post_comment', 'XenForo', '')

Code:
INSERT IGNORE INTO xf_content_type_field
    (content_type, field_name, field_value)
VALUES
    ('profile_post_comment', 'alert_handler_class', 'XenForo_AlertHandler_ProfilePostComment'),
    ('profile_post_comment', 'like_handler_class', 'XenForo_LikeHandler_ProfilePostComment'),
    ('profile_post_comment', 'news_feed_handler_class', 'XenForo_NewsFeedHandler_ProfilePostComment')

And finally:

Code:
DELETE FROM xf_data_registry WHERE data_key = 'contentTypes'
Oops! I forgot update the field class for that content type :eek:
 
Top Bottom