Fixed Mass revert post edit history endless loop

dutchbb

Well-known member
Tried to revert a change to 11k posts, but went over the /amount and keeps going. No php process running that indicates it is working.

I also had to remove 'super admin' from my account to have the option. The changes i wanted to revert are also from other account posts.

user edit revert.webp
 
Could it be the amount of posts? Limiting to 500 possible solution? I also had to increase the memory_limit to get it working.

fixed! (with the help of @AndyB) was the amount of posts. Limited it to 1 to test en will increase now.

Edit: 50 is max, over that it keeps going.

library/XenForo/Model/EditHistory.php

PHP:
public function getEditHistoryByUserSinceDate($userId, $cutOff, array $fetchOptions = array())
{
    $joinOptions = $this->prepareEditHistoryFetchOptions($fetchOptions);

    return $this->fetchAllKeyed('
        SELECT history.edit_history_id, history.edit_user_id, history.edit_date
            ' . $joinOptions['selectFields'] . '
        FROM xf_edit_history AS history
        ' . $joinOptions['joinTables'] . '
        WHERE history.edit_user_id = ?
            AND history.edit_date >= ?
        ORDER BY history.edit_date DESC
        LIMIT 1
    ', 'edit_history_id', array($userId, $cutOff));
}
 
Last edited:
I can reproduce this. Close the window to stop the task from running for now. I'm looking into a fix/workaround.
 
Top Bottom