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

XF 1.5 Edit History

Discussion in 'XenForo Questions and Support' started by The Sandman, Aug 8, 2015.

  1. The Sandman

    The Sandman Well-Known Member

    I edited a post (first and only post in a thread) and deleted an image. Now I want to see the image url - the "History" link shows at the bottom of the post but when I click it I get a popup error message telling me the content hasn't been edited. Is this normal behavior?
     
  2. imthebest

    imthebest Formerly Super120

    This sounds like either a bug or a problematic add-on.

    Are you able to reproduce this on a stock 1.5RC1 test install?
     
  3. Xon

    Xon Well-Known Member

    This means the edit history has been deleted, but the edit count is still non-zero.

    Check how quickly edit history is set to expire, it could be something silly fast. Otherwise it is likely some addon issue.
     
  4. Mike

    Mike XenForo Developer Staff Member

    If it's specifically saying it's not been edited, then that line is actually hitting edit_count = 0, though in posts the history link only shows if there is an edit_count value, so I would have to guess an add-on at play.
     
    SneakyDave likes this.
  5. The Sandman

    The Sandman Well-Known Member

    I'll see if I can narrow it down to a particular add-on then:

    upload_2015-8-8_19-11-43.png
    upload_2015-8-8_19-12-21.png
     
  6. Mike

    Mike XenForo Developer Staff Member

    FWIW, it could be an add-on adding an edit_count field to another table (one that gets joined with the post table). Disabling add-ons won't necessarily avoid an issue caused by that, unfortunately.
     
    SneakyDave likes this.
  7. The Sandman

    The Sandman Well-Known Member

    So what's the recommended procedure for troubleshooting something like this? :eek:
     
  8. Xon

    Xon Well-Known Member

    This query should do it, just replace <my database> with your database name:
    Code:
    SELECT TABLE_NAME
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_SCHEMA = '<my database>' and COLUMN_NAME = 'edit_count'
    
     
    Mike, Chris D and The Sandman like this.
  9. MattW

    MattW Well-Known Member

    Code:
    MariaDB [the_admin_zone]> SELECT TABLE_NAME
        -> FROM INFORMATION_SCHEMA.COLUMNS
        -> WHERE TABLE_SCHEMA = 'the_admin_zone' and COLUMN_NAME = 'edit_count'            
        -> ;
    +------------+
    | TABLE_NAME |
    +------------+
    | xf_post    |
    | xf_thread  |
    +------------+
    2 rows in set (0.01 sec)
    
    MariaDB [the_admin_zone]> 
     
  10. Chris D

    Chris D XenForo Developer Staff Member

    Mike was spot on.

    xf_thread has a edit_count field - that isn't added to XF by default.

    You may have to search the files in your webroot/library directory for PHP files containing "edit_count". This will likely point to the add-on that has added this.
     
    Xon likes this.
  11. MattW

    MattW Well-Known Member

    Code:
    # grep -iR edit_count *
    SV/TitleEditHistory/Listener.php:            SV_TitleEditHistory_Install::addColumn('xf_thread','thread_title_edit_count', 'int not null default 0');
    SV/TitleEditHistory/Listener.php:            SV_TitleEditHistory_Install::renameColumn('xf_thread','edit_count', 'thread_title_edit_count', 'int not null default 0');
    SV/TitleEditHistory/EditHistoryHandler/Thread.php:        $dw->set('thread_title_edit_count', $dw->get('thread_title_edit_count') + 1);
    SV/TitleEditHistory/EditHistoryHandler/Thread.php:        if ($dw->get('thread_title_edit_count'))
    SV/TitleEditHistory/XenForo/DataWriter/Discussion/Thread.php:        $fields["xf_thread"]['thread_title_edit_count'] = array('type' => self::TYPE_UINT_FORCED, 'default' => 0);
    SV/TitleEditHistory/XenForo/DataWriter/Discussion/Thread.php:            $this->set('thread_title_edit_count', $this->get('thread_title_edit_count') + 1);
    UserEss/Install/Construct.php:                                                          $editArray[$contentId]['edit_count'] += 1;
    UserEss/Install/Construct.php:                                                          $editArray[$contentId] = array('edit_count' => 1, 'edit_date' => $postEdit['edit_date'], 'edit_user_id' => $postEdit['edit_user_id']);
    UserEss/Install/Construct.php:                                                          $postWriter->set('edit_count', $postWriter->get('edit_count') + $editArray[$postId]['edit_count']);
    XenForo/ControllerPublic/EditHistory.php:               if (isset($content['edit_count']) && !$content['edit_count'])
    XenForo/EditHistoryHandler/Post.php:            $dw->set('edit_count', $dw->get('edit_count') + 1);
    XenForo/EditHistoryHandler/Post.php:            if ($dw->get('edit_count'))
    XenForo/Install/Data/MySql.php:         edit_count INT UNSIGNED NOT NULL DEFAULT 0,
    XenForo/Install/Upgrade/1020010-120a.php:                               ADD edit_count INT UNSIGNED NOT NULL DEFAULT 0
    XenForo/Model/Post.php:         $newPost['edit_count'] = 0;
    XenForo/DataWriter/DiscussionMessage.php:                       $fields[$structure['table']]['edit_count'] = array('type' => self::TYPE_UINT_FORCED, 'default' => 0);
    XenForo/DataWriter/DiscussionMessage.php:                               if (!$this->isChanged('edit_count'))
    XenForo/DataWriter/DiscussionMessage.php:                                       $this->set('edit_count', $this->get('edit_count') + 1);
    XenForo/DataWriter/DiscussionMessage.php:                       if ($this->isChanged('edit_count') && $this->get('edit_count') == 0)
    XenForo/DataWriter/DiscussionMessage.php:                       && $this->isUpdate() && $this->isChanged('edit_count') && $this->get('edit_count'))
    XenForo/Importer/IPBoard.php:                                           'edit_count' => !empty($post['edit_date']) ? 1 : 0
    XenForo/Importer/vBulletin.php:                                         'edit_count' => !empty($post['editdate']) ? 1 : 0
    XenForo/Importer/XenForo.php:                                           'edit_count',
     
  12. imthebest

    imthebest Formerly Super120

  13. Xon

    Xon Well-Known Member

    My Thread Title Edit History addon should have moved from edit_count -> thread_title_edit_count because of this issue. But I guess the updater might be buggy. :(
     
  14. The Sandman

    The Sandman Well-Known Member

    There was an issue with Xon's Thread Title Edit History - thanks to @Xon and @MattW it's all sorted now. :D
     
    Xon and MattW like this.

Share This Page