XF 1.5 Upgrade from 1.5 to 2.1 with Robbo's Edit History still installed

Kintaro

Well-known member
I'm doing some cleaning before a 1.5=>2.1 (or 2.2) upgrade. I'm testing it in a sandbox

In the 1.5 I still have Robbo's Edit History addon installed (disabled).
Once I uninstalled it I can't post anymore as the uninstall is doing this:

Code:
    protected function _uninstallVersion1()
        {
                $this->_db->query('DROP TABLE merc_history');
                $this->_db->query('DROP TABLE merc_history_record');

                $this->_removeTableColumn('xf_post', 'edit_count');
                $this->_removeTableColumn('xf_post', 'last_edit_username');
                $this->_removeTableColumn('xf_post', 'last_edit_user_id');
                $this->_removeTableColumn('xf_post', 'last_edit_date');

                // TODO: fix xenplus so we can remove this properly
                //$this->_removeContentType('post', 'history_handler_class');
        }

Now... I'm quite sure that Robbo's Edit History was installed before a 1.2 upgrade.
The 1.2 upgrade add this 3 column to xf_post:
Code:
ALTER TABLE xf_post
    ADD last_edit_date INT UNSIGNED NOT NULL DEFAULT 0,
    ADD last_edit_user_id INT UNSIGNED NOT NULL DEFAULT 0,
    ADD edit_count INT UNSIGNED NOT NULL DEFAULT 0

source here from @Brogan : https://xenforo.com/community/threads/impossible-posting-and-creating-new-thread.112622/#post-103923

What do you suggest to do?
Simply to comments the uninstall function like this?

Code:
    protected function _uninstallVersion1()
        {
                $this->_db->query('DROP TABLE merc_history');
                $this->_db->query('DROP TABLE merc_history_record');

               // $this->_removeTableColumn('xf_post', 'edit_count');
                $this->_removeTableColumn('xf_post', 'last_edit_username');
               // $this->_removeTableColumn('xf_post', 'last_edit_user_id');
               // $this->_removeTableColumn('xf_post', 'last_edit_date');

                // TODO: fix xenplus so we can remove this properly
                //$this->_removeContentType('post', 'history_handler_class');
        }

So, during the uninstall process, it will remove only the xf_post column named: last_edit_username that AFAIK is not a xf 1.5 standard xf_post column.
 
I recreated the tables in my sandbox and now the problem is fixed... but uninstalling that addon wiped all the history (also the core one).

I'm going to warn who has that specific addon to comment those lines otherways you are going to lose all the post history.
 
Top Bottom