[OzzModz/Banxix] Bump Thread

[OzzModz/Banxix] Bump Thread 2.1.2 Patch Level 1

No permission to download
After installing add-on, topics with a large number of replies, not displayed on the list of topics in forum.
Threads containing more than 4000 replies are not displayed.
Can you advise something ?
 
To simulate what this addon is finally doing, i can use one of the addons to change the post_date of posts and change the post_date of the last post in a thread to now. This also changes the field xf_thread.last_post_date to now. The next view of thread_list shows now our thread at the top.

But!

We have changed the post_date of a post owned by someone and have changed the time of creation.

Now my question to you: What will happen, if we
dont change xf_post.post_date and
do change xf_thread.post_date only?

The last post is not touched, the thread has a wrong value for last_post_date till we bump again or someone writes a new post.
Is there any reason not to do this?

Code:
/*
        $db->query("
            UPDATE xf_post
            SET post_date = ?
            WHERE post_id = ?
        ", [\XF::$time, $thread->last_post_id]);

*/
 
But i see another problem now! When i bump a thread (with or without my changes), it is shown to me as "new" with a bolded title in thread_list.
Probably this is shown to everyone else also bolded now? This means that i believe to find a new post in this thread, but there is nothing new for me!

I feel tricked now, right?

Finally this is not the perfect solution.


We can sort the thread by

sort by "thread.new_field_with_bump_date DESC, thread.last_post_date DESC",

but then we have to get rid of the value inside thread.new_field_with_bump_date after some time with a cron_job;

some hours after a bump or every night at 2:00 for all bumped ones.


Any other idea?
 
Hey @Ozzy47, getting a bunch of these errors after updating to XF 2.2.6 P2. Any ideas?

Code:
Server error log

    XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'bump_log.bump_date' in 'order clause' src/XF/Db/AbstractStatement.php:228

    Generated by: Unknown account Aug 12, 2021 at 3:09 AM

Stack trace

            SELECT `xf_thread`.*, `xf_user_User_1`.*, `xf_user_LastPoster_2`.*
            FROM (
            
            SELECT `xf_thread`.`thread_id`
            FROM `xf_thread`
LEFT JOIN (
                SELECT thread_id, max(bump_date) as bump_date
                FROM xf_bump_thread_log
                GROUP BY thread_id
            ) AS `bump_log` ON (`bump_log`.`thread_id` = `xf_thread`.`thread_id`)
            
            WHERE (`xf_thread`.`node_id` = 41) AND ((`xf_thread`.`discussion_state` IN ('visible'))) AND (`xf_thread`.`sticky` = 0)
            ORDER BY IFNULL(`bump_log`.`bump_date`, `xf_thread`.`post_date`) DESC
        
LIMIT 40 OFFSET 10920
            ) as `earlyJoinQuery_3`
            JOIN `xf_thread` ON (`xf_thread`.`thread_id` = `earlyJoinQuery_3`.`thread_id`)
            LEFT JOIN `xf_user` AS `xf_user_User_1` ON (`xf_user_User_1`.`user_id` = `xf_thread`.`user_id`)
LEFT JOIN `xf_user` AS `xf_user_LastPoster_2` ON (`xf_user_LastPoster_2`.`user_id` = `xf_thread`.`last_post_user_id`)
            ORDER BY IFNULL(`bump_log`.`bump_date`, `xf_thread`.`post_date`) DESC
        
LIMIT 40
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Mvc/Entity/Finder.php(1379): XF\Db\AbstractAdapter->query('
            SELECT `xf_...')
#5 src/addons/SV/AggregatingForums/XF/Finder/Thread.php(110): XF\Mvc\Entity\Finder->fetch(NULL, NULL)
#6 src/XF/Pub/Controller/Forum.php(247): SV\AggregatingForums\XF\Finder\Thread->fetch()
#7 src/addons/AL/ThreadFilter/XF/Pub/Controller/Forum.php(90): XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#8 src/addons/EWR/Atendo/Pub/Controller/Forum.php(11): AL\ThreadFilter\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#9 src/addons/SV/AggregatingForums/XF/Pub/Controller/Forum.php(34): EWR\Atendo\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#10 src/addons/SV/OptimizedListQueries/XF/Pub/Controller/Forum.php(31): SV\AggregatingForums\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#11 src/addons/AddonFlare/GlobalIgnore/XF/Pub/Controller/Forum.php(21): SV\OptimizedListQueries\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(350): AddonFlare\GlobalIgnore\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#13 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'Forum', Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
#14 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
#15 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#16 src/XF/App.php(2344): XF\Mvc\Dispatcher->run()
#17 src/XF.php(512): XF\App->run()
#18 index.php(20): XF::runApp('XF\\Pub\\App')
#19 {main}

Request state

array(4) {
  ["url"] => string(32) "/category/forum/page-274"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/category/forum/page-274"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
Hey @Ozzy47, getting a bunch of these errors after updating to XF 2.2.6 P2. Any ideas?

Code:
Server error log

    XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'bump_log.bump_date' in 'order clause' src/XF/Db/AbstractStatement.php:228

    Generated by: Unknown account Aug 12, 2021 at 3:09 AM

Stack trace

            SELECT `xf_thread`.*, `xf_user_User_1`.*, `xf_user_LastPoster_2`.*
            FROM (
           
            SELECT `xf_thread`.`thread_id`
            FROM `xf_thread`
LEFT JOIN (
                SELECT thread_id, max(bump_date) as bump_date
                FROM xf_bump_thread_log
                GROUP BY thread_id
            ) AS `bump_log` ON (`bump_log`.`thread_id` = `xf_thread`.`thread_id`)
           
            WHERE (`xf_thread`.`node_id` = 41) AND ((`xf_thread`.`discussion_state` IN ('visible'))) AND (`xf_thread`.`sticky` = 0)
            ORDER BY IFNULL(`bump_log`.`bump_date`, `xf_thread`.`post_date`) DESC
       
LIMIT 40 OFFSET 10920
            ) as `earlyJoinQuery_3`
            JOIN `xf_thread` ON (`xf_thread`.`thread_id` = `earlyJoinQuery_3`.`thread_id`)
            LEFT JOIN `xf_user` AS `xf_user_User_1` ON (`xf_user_User_1`.`user_id` = `xf_thread`.`user_id`)
LEFT JOIN `xf_user` AS `xf_user_LastPoster_2` ON (`xf_user_LastPoster_2`.`user_id` = `xf_thread`.`last_post_user_id`)
            ORDER BY IFNULL(`bump_log`.`bump_date`, `xf_thread`.`post_date`) DESC
       
LIMIT 40
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Mvc/Entity/Finder.php(1379): XF\Db\AbstractAdapter->query('
            SELECT `xf_...')
#5 src/addons/SV/AggregatingForums/XF/Finder/Thread.php(110): XF\Mvc\Entity\Finder->fetch(NULL, NULL)
#6 src/XF/Pub/Controller/Forum.php(247): SV\AggregatingForums\XF\Finder\Thread->fetch()
#7 src/addons/AL/ThreadFilter/XF/Pub/Controller/Forum.php(90): XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#8 src/addons/EWR/Atendo/Pub/Controller/Forum.php(11): AL\ThreadFilter\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#9 src/addons/SV/AggregatingForums/XF/Pub/Controller/Forum.php(34): EWR\Atendo\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#10 src/addons/SV/OptimizedListQueries/XF/Pub/Controller/Forum.php(31): SV\AggregatingForums\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#11 src/addons/AddonFlare/GlobalIgnore/XF/Pub/Controller/Forum.php(21): SV\OptimizedListQueries\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(350): AddonFlare\GlobalIgnore\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#13 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'Forum', Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
#14 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
#15 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#16 src/XF/App.php(2344): XF\Mvc\Dispatcher->run()
#17 src/XF.php(512): XF\App->run()
#18 index.php(20): XF::runApp('XF\\Pub\\App')
#19 {main}

Request state

array(4) {
  ["url"] => string(32) "/category/forum/page-274"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/category/forum/page-274"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

Any ideas @Ozzy47? Getting at least a few of these per hour.
 
I have run into a minor issue with this add-on. While it functions correctly in terms of bumping, every setting I have tried creates either two copies of the button or none beside "Post reply"

I have tried different permission combinations and the add-on settings. I can remove both or place one button on either side of "Post reply", but cannot get rid of just one.

1632782293006.webp
 
Hey @Ozzy47, getting a bunch of these errors after updating to XF 2.2.6 P2. Any ideas?

Code:
Server error log

    XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'bump_log.bump_date' in 'order clause' src/XF/Db/AbstractStatement.php:228

    Generated by: Unknown account Aug 12, 2021 at 3:09 AM

Stack trace

            SELECT `xf_thread`.*, `xf_user_User_1`.*, `xf_user_LastPoster_2`.*
            FROM (
           
            SELECT `xf_thread`.`thread_id`
            FROM `xf_thread`
LEFT JOIN (
                SELECT thread_id, max(bump_date) as bump_date
                FROM xf_bump_thread_log
                GROUP BY thread_id
            ) AS `bump_log` ON (`bump_log`.`thread_id` = `xf_thread`.`thread_id`)
           
            WHERE (`xf_thread`.`node_id` = 41) AND ((`xf_thread`.`discussion_state` IN ('visible'))) AND (`xf_thread`.`sticky` = 0)
            ORDER BY IFNULL(`bump_log`.`bump_date`, `xf_thread`.`post_date`) DESC
       
LIMIT 40 OFFSET 10920
            ) as `earlyJoinQuery_3`
            JOIN `xf_thread` ON (`xf_thread`.`thread_id` = `earlyJoinQuery_3`.`thread_id`)
            LEFT JOIN `xf_user` AS `xf_user_User_1` ON (`xf_user_User_1`.`user_id` = `xf_thread`.`user_id`)
LEFT JOIN `xf_user` AS `xf_user_LastPoster_2` ON (`xf_user_LastPoster_2`.`user_id` = `xf_thread`.`last_post_user_id`)
            ORDER BY IFNULL(`bump_log`.`bump_date`, `xf_thread`.`post_date`) DESC
       
LIMIT 40
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Mvc/Entity/Finder.php(1379): XF\Db\AbstractAdapter->query('
            SELECT `xf_...')
#5 src/addons/SV/AggregatingForums/XF/Finder/Thread.php(110): XF\Mvc\Entity\Finder->fetch(NULL, NULL)
#6 src/XF/Pub/Controller/Forum.php(247): SV\AggregatingForums\XF\Finder\Thread->fetch()
#7 src/addons/AL/ThreadFilter/XF/Pub/Controller/Forum.php(90): XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#8 src/addons/EWR/Atendo/Pub/Controller/Forum.php(11): AL\ThreadFilter\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#9 src/addons/SV/AggregatingForums/XF/Pub/Controller/Forum.php(34): EWR\Atendo\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#10 src/addons/SV/OptimizedListQueries/XF/Pub/Controller/Forum.php(31): SV\AggregatingForums\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#11 src/addons/AddonFlare/GlobalIgnore/XF/Pub/Controller/Forum.php(21): SV\OptimizedListQueries\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(350): AddonFlare\GlobalIgnore\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#13 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'Forum', Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
#14 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
#15 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#16 src/XF/App.php(2344): XF\Mvc\Dispatcher->run()
#17 src/XF.php(512): XF\App->run()
#18 index.php(20): XF::runApp('XF\\Pub\\App')
#19 {main}

Request state

array(4) {
  ["url"] => string(32) "/category/forum/page-274"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/category/forum/page-274"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

@Ozzy47

Updated to 2.1.1 yesterday and for some reason I'm still seeing these errors. Tried reinstalling with the overwrite box checked too, no luck.
 
Top Bottom