1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Unable to Like Profile Post Comments

Discussion in 'Troubleshooting and Problems' started by The Sandman, Jul 27, 2015.

  1. The Sandman

    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?
     
  2. Mike

    Mike XenForo Developer Staff Member

    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.
     
  3. The Sandman

    The Sandman Well-Known Member

    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.
     
  4. imthebest

    imthebest Formerly Super120

    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
     
  5. Chris D

    Chris D XenForo Developer Staff Member

    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: Aug 25, 2015
    Dadparvar likes this.
  6. The Sandman

    The Sandman Well-Known Member

    I'm already running 1.5, so upgrading to 1.5 isn't an option.
     
  7. The Sandman

    The Sandman Well-Known Member

    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]>
     
  8. batpool52!

    batpool52! Well-Known Member

    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'
    
     
    MattW and The Sandman like this.
  9. MattW

    MattW Well-Known Member

    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]> 
     
    The Sandman likes this.
  10. Chris D

    Chris D XenForo Developer Staff Member

    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'
     
    Pinn, Nobita.Kun, batpool52! and 2 others like this.
  11. MattW

    MattW Well-Known Member

    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]> 
     
  12. Chris D

    Chris D XenForo Developer Staff Member

    There was one more I added on Matt that should fix it.
     
  13. MattW

    MattW Well-Known Member

    Thanks Chris, just ran the final one.
     
  14. The Sandman

    The Sandman Well-Known Member

    Thanks guys, but it's still not working. :eek:
     
  15. Chris D

    Chris D XenForo Developer Staff Member

  16. The Sandman

    The Sandman Well-Known Member

    Ah, it does seem to be working after doing a "Rebuild XenForo" run.

    Thanks to Chris, Matt, and Batpool52!
     
    Chris D, batpool52! and MattW like this.
  17. Nobita.Kun

    Nobita.Kun Well-Known Member

    Oops! I forgot update the field class for that content type :eek:
     
  18. Pinn

    Pinn Active Member

    @Chris D Thanks!! It works, i have the Bug to Months..... Thank you!!
     

Share This Page