• 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

The Sandman

Well-known member
#1
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?
 

imthebest

Formerly Super120
#2
This sounds like either a bug or a problematic add-on.

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

Xon

Well-known member
#3
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.
 

Mike

XenForo developer
Staff member
#4
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.
 

Mike

XenForo developer
Staff member
#6
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.
 

The Sandman

Well-known member
#7
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.
So what's the recommended procedure for troubleshooting something like this? :eek:
 

MattW

Well-known member
#9
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]>
 

Chris D

XenForo developer
Staff member
#10
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.
 

MattW

Well-known member
#11
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',