php8-Ready?
bug-i opened this issue · 10 comments
I just switched from php74 to php8, and recent topics seems not to be compatible with php8.
After deactivation of recent topics it is working fine under php8. Would you be so kind and investigate this?
No issues with recent topics and php74
Specifications
- phpbb version: 3.3.3
- recenttopics version: 2.2.14
Same problem here.
[Tue Mar 02 13:09:59.941970 2021] [php:error] [pid 16419] [client 212.69.47.157:51084] PHP Fatal error: Uncaught TypeError: mysqli_data_seek(): Argument #2 ($offset) must be of type int, mysqli_result given in /var/www/html/forum2/phpbb/db/driver/mysqli.php:281\nStack trace:\n#0 /var/www/html/forum2/phpbb/db/driver/mysqli.php(281): mysqli_data_seek()\n#1 /var/www/html/forum2/phpbb/db/driver/driver.php(381): phpbb\\db\\driver\\mysqli->sql_rowseek()\n#2 /var/www/html/forum2/phpbb/db/driver/factory.php(297): phpbb\\db\\driver\\driver->sql_fetchfield()\n#3 /var/www/html/forum2/ext/paybas/recenttopics/core/recenttopics.php(475): phpbb\\db\\driver\\factory->sql_fetchfield()\n#4 /var/www/html/forum2/ext/paybas/recenttopics/core/recenttopics.php(330): paybas\\recenttopics\\core\\recenttopics->gettopiclist()\n#5 /var/www/html/forum2/ext/paybas/recenttopics/event/listener.php(71): paybas\\recenttopics\\core\\recenttopics->display_recent_topics()\n#6 /var/www/html/forum2/vendor/symfony/event-dispatcher/EventDispatcher.php(214): paybas\\recenttopics\\event\\listener->display_rt()\n#7 /var/www/html/forum2/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\\Component\\EventDispatcher\\EventDispatcher->doDispatch()\n#8 /var/www/html/forum2/phpbb/event/dispatcher.php(62): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch()\n#9 /var/www/html/forum2/phpbb/event/dispatcher.php(46): phpbb\\event\\dispatcher->dispatch()\n#10 /var/www/html/forum2/index.php(244): phpbb\\event\\dispatcher->trigger_event()\n#11 {main}\n thrown in /var/www/html/forum2/phpbb/db/driver/mysqli.php on line 281, referer: https://www.exxosforum.co.uk/forum2/adm/index.php?i=acp_extensions&sid=c778e9f2ec4364c4f83b84f34d3395be&mode=main&action=enable&ext_name=rmcgirr83%2Fstopforumspam&hash=85bace1f [Tue Mar 02 13:10:06.213810 2021] [php:error] [pid 16416] [client 212.69.47.157:51086] PHP Fatal error: Uncaught TypeError: mysqli_data_seek(): Argument #2 ($offset) must be of type int, mysqli_result given in /var/www/html/forum2/phpbb/db/driver/mysqli.php:281\nStack trace:\n#0 /var/www/html/forum2/phpbb/db/driver/mysqli.php(281): mysqli_data_seek()\n#1 /var/www/html/forum2/phpbb/db/driver/driver.php(381): phpbb\\db\\driver\\mysqli->sql_rowseek()\n#2 /var/www/html/forum2/phpbb/db/driver/factory.php(297): phpbb\\db\\driver\\driver->sql_fetchfield()\n#3 /var/www/html/forum2/ext/paybas/recenttopics/core/recenttopics.php(475): phpbb\\db\\driver\\factory->sql_fetchfield()\n#4 /var/www/html/forum2/ext/paybas/recenttopics/core/recenttopics.php(330): paybas\\recenttopics\\core\\recenttopics->gettopiclist()\n#5 /var/www/html/forum2/ext/paybas/recenttopics/event/listener.php(71): paybas\\recenttopics\\core\\recenttopics->display_recent_topics()\n#6 /var/www/html/forum2/vendor/symfony/event-dispatcher/EventDispatcher.php(214): paybas\\recenttopics\\event\\listener->display_rt()\n#7 /var/www/html/forum2/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\\Component\\EventDispatcher\\EventDispatcher->doDispatch()\n#8 /var/www/html/forum2/phpbb/event/dispatcher.php(62): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch()\n#9 /var/www/html/forum2/phpbb/event/dispatcher.php(46): phpbb\\event\\dispatcher->dispatch()\n#10 /var/www/html/forum2/index.php(244): phpbb\\event\\dispatcher->trigger_event()\n#11 {main}\n thrown in /var/www/html/forum2/phpbb/db/driver/mysqli.php on line 281, referer: https://www.exxosforum.co.uk/forum2/adm/index.php?i=acp_extensions&sid=c778e9f2ec4364c4f83b84f34d3395be&mode=main&action=enable&ext_name=rmcgirr83%2Fstopforumspam&hash=85bace1f [Tue Mar 02 13:18:08.493868 2021] [php:error] [pid 16415] [client 212.69.47.157:51188] PHP Fatal error: Uncaught TypeError: mysqli_real_escape_string(): Argument #2 ($string) must be of type string, array given in /var/www/html/forum2/phpbb/db/driver/mysqli.php:327\nStack trace:\n#0 /var/www/html/forum2/phpbb/db/driver/mysqli.php(327): mysqli_real_escape_string()\n#1 /var/www/html/forum2/phpbb/db/driver/factory.php(425): phpbb\\db\\driver\\mysqli->sql_escape()\n#2 /var/www/html/forum2/phpbb/db/migration/tool/module.php(125): phpbb\\db\\driver\\factory->sql_escape()\n#3 [internal function]: phpbb\\db\\migration\\tool\\module->exists()\n#4 /var/www/html/forum2/phpbb/db/migrator.php(714): call_user_func_array()\n#5 /var/www/html/forum2/phpbb/db/migrator.php(763): phpbb\\db\\migrator->run_step()\n#6 /var/www/html/forum2/phpbb/db/migrator.php(704): phpbb\\db\\migrator->get_callable_from_step()\n#7 /var/www/html/forum2/phpbb/db/migrator.php(661): phpbb\\db\\migrator->run_step()\n#8 /var/www/html/forum2/phpbb/db/migrator.php(436): phpbb\\db\\migrator->process_data_step()\n#9 /var/www/html/forum2/phpbb/db/migrator.php(288): phpbb\\db\\migrator->try_apply()\n#10 /var/www/html/forum2/phpbb/db/migrator.php(241): phpbb\\db\\migrator->update_do()\n#11 /var/www/html/forum2/phpbb/extension/base.php(78): phpbb\\db\\migrator->update()\n#12 /var/www/html/forum2/phpbb/extension/manager.php(231): phpbb\\extension\\base->enable_step()\n#13 /var/www/html/forum2/includes/acp/acp_extensions.php(209): phpbb\\extension\\manager->enable_step()\n#14 /var/www/html/forum2/includes/functions_module.php(676): acp_extensions->main()\n#15 /var/www/html/forum2/adm/index.php(81): p_master->load_active()\n#16 {main}\n thrown in /var/www/html/forum2/phpbb/db/driver/mysqli.php on line 327, referer: https://www.exxosforum.co.uk/forum2/adm/index.php?i=acp_extensions&sid=c778e9f2ec4364c4f83b84f34d3395be&mode=main&action=enable_pre&ext_name=paybas%2Frecenttopics [Tue Mar 02 13:18:41.914995 2021] [php:error] [pid 16419] [client 212.69.47.157:51201] PHP Fatal error: Uncaught TypeError: mysqli_real_escape_string(): Argument #2 ($string) must be of type string, array given in /var/www/html/forum2/phpbb/db/driver/mysqli.php:327\nStack trace:\n#0 /var/www/html/forum2/phpbb/db/driver/mysqli.php(327): mysqli_real_escape_string()\n#1 /var/www/html/forum2/phpbb/db/driver/factory.php(425): phpbb\\db\\driver\\mysqli->sql_escape()\n#2 /var/www/html/forum2/phpbb/db/migration/tool/module.php(125): phpbb\\db\\driver\\factory->sql_escape()\n#3 [internal function]: phpbb\\db\\migration\\tool\\module->exists()\n#4 /var/www/html/forum2/phpbb/db/migrator.php(714): call_user_func_array()\n#5 /var/www/html/forum2/phpbb/db/migrator.php(763): phpbb\\db\\migrator->run_step()\n#6 /var/www/html/forum2/phpbb/db/migrator.php(704): phpbb\\db\\migrator->get_callable_from_step()\n#7 /var/www/html/forum2/phpbb/db/migrator.php(661): phpbb\\db\\migrator->run_step()\n#8 /var/www/html/forum2/phpbb/db/migrator.php(436): phpbb\\db\\migrator->process_data_step()\n#9 /var/www/html/forum2/phpbb/db/migrator.php(288): phpbb\\db\\migrator->try_apply()\n#10 /var/www/html/forum2/phpbb/db/migrator.php(241): phpbb\\db\\migrator->update_do()\n#11 /var/www/html/forum2/phpbb/extension/base.php(78): phpbb\\db\\migrator->update()\n#12 /var/www/html/forum2/phpbb/extension/manager.php(231): phpbb\\extension\\base->enable_step()\n#13 /var/www/html/forum2/includes/acp/acp_extensions.php(209): phpbb\\extension\\manager->enable_step()\n#14 /var/www/html/forum2/includes/functions_module.php(676): acp_extensions->main()\n#15 /var/www/html/forum2/adm/index.php(81): p_master->load_active()\n#16 {main}\n thrown in /var/www/html/forum2/phpbb/db/driver/mysqli.php on line 327, referer: https://www.exxosforum.co.uk/forum2/adm/index.php?i=acp_extensions&sid=c778e9f2ec4364c4f83b84f34d3395be&mode=main&action=enable_pre&ext_name=paybas%2Frecenttopics [Tue Mar 02 13:18:59.389346 2021] [php:error] [pid 16527] [client 212.69.47.157:51203] PHP Fatal error: Uncaught TypeError: mysqli_real_escape_string(): Argument #2 ($string) must be of type string, array given in /var/www/html/forum2/phpbb/db/driver/mysqli.php:327\nStack trace:\n#0 /var/www/html/forum2/phpbb/db/driver/mysqli.php(327): mysqli_real_escape_string()\n#1 /var/www/html/forum2/phpbb/db/driver/factory.php(425): phpbb\\db\\driver\\mysqli->sql_escape()\n#2 /var/www/html/forum2/phpbb/db/migration/tool/module.php(125): phpbb\\db\\driver\\factory->sql_escape()\n#3 [internal function]: phpbb\\db\\migration\\tool\\module->exists()\n#4 /var/www/html/forum2/phpbb/db/migrator.php(714): call_user_func_array()\n#5 /var/www/html/forum2/phpbb/db/migrator.php(763): phpbb\\db\\migrator->run_step()\n#6 /var/www/html/forum2/phpbb/db/migrator.php(704): phpbb\\db\\migrator->get_callable_from_step()\n#7 /var/www/html/forum2/phpbb/db/migrator.php(661): phpbb\\db\\migrator->run_step()\n#8 /var/www/html/forum2/phpbb/db/migrator.php(436): phpbb\\db\\migrator->process_data_step()\n#9 /var/www/html/forum2/phpbb/db/migrator.php(288): phpbb\\db\\migrator->try_apply()\n#10 /var/www/html/forum2/phpbb/db/migrator.php(241): phpbb\\db\\migrator->update_do()\n#11 /var/www/html/forum2/phpbb/extension/base.php(78): phpbb\\db\\migrator->update()\n#12 /var/www/html/forum2/phpbb/extension/manager.php(231): phpbb\\extension\\base->enable_step()\n#13 /var/www/html/forum2/includes/acp/acp_extensions.php(209): phpbb\\extension\\manager->enable_step()\n#14 /var/www/html/forum2/includes/functions_module.php(676): acp_extensions->main()\n#15 /var/www/html/forum2/adm/index.php(81): p_master->load_active()\n#16 {main}\n thrown in /var/www/html/forum2/phpbb/db/driver/mysqli.php on line 327, referer: https://www.exxosforum.co.uk/forum2/adm/index.php?i=acp_extensions&sid=c778e9f2ec4364c4f83b84f34d3395be&mode=main&action=enable_pre&ext_name=paybas%2Frecenttopics
I'm not sure what happened in php 3.3.3 / php 8.0, i can reproduce this error but not fix it.
There are some bugs in phpbb 3.3.3 regarding php 8, so not all errors necessarily are caused by recent topics.
See also here https://www.phpbb.com/community/viewtopic.php?f=661&t=2589106
Have you seen the discussion regarding your extension at phpbb.com?
here: https://www.phpbb.com/community/viewtopic.php?f=496&t=2584461
and here: https://www.phpbb.com/customise/db/extension/recent_topics_2/support/topic/227101
everyone is crossing fingers that you can fix recent topics. Also some ideads / fixes have been made.
This commit fixes the migration.
hmm. Just tested with your latest commits here from github (5 Minutes ago) and still receive this error, some of them regarding recent topics with php8
Can I provide any additional information or data to support you in fixing this?
Fatal error: Uncaught TypeError: mysqli_data_seek(): Argument #2 ($offset) must be of type int, mysqli_result given in /home/web3xp3r4/html/phpBB3/phpbb/db/driver/mysqli.php:281 Stack trace: #0 /home/web3xp3r4/html/phpBB3/phpbb/db/driver/mysqli.php(281): mysqli_data_seek(Object(mysqli_result), Object(mysqli_result)) #1 /home/web3xp3r4/html/phpBB3/phpbb/db/driver/driver.php(381): phpbb\db\driver\mysqli->sql_rowseek(Object(mysqli_result), Object(mysqli_result)) #2 /home/web3xp3r4/html/phpBB3/phpbb/db/driver/factory.php(297): phpbb\db\driver\driver->sql_fetchfield('topic_count', Object(mysqli_result), Object(mysqli_result)) #3 /home/web3xp3r4/html/phpBB3/ext/paybas/recenttopics/core/recenttopics.php(311): phpbb\db\driver\factory->sql_fetchfield('topic_count', Object(mysqli_result)) #4 /home/web3xp3r4/html/phpBB3/ext/paybas/recenttopics/event/listener.php(71): paybas\recenttopics\core\recenttopics->display_recent_topics() #5 /home/web3xp3r4/html/phpBB3/vendor/symfony/event-dispatcher/EventDispatcher.php(214): paybas\recenttopics\event\listener->display_rt(Object(phpbb\event\data), 'core.index_modi...', Object(phpbb\event\dispatcher)) #6 /home/web3xp3r4/html/phpBB3/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'core.index_modi...', Object(phpbb\event\data)) #7 /home/web3xp3r4/html/phpBB3/phpbb/event/dispatcher.php(62): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('core.index_modi...', Object(phpbb\event\data)) #8 /home/web3xp3r4/html/phpBB3/phpbb/event/dispatcher.php(46): phpbb\event\dispatcher->dispatch('core.index_modi...', Object(phpbb\event\data)) #9 /home/web3xp3r4/html/phpBB3/index.php(244): phpbb\event\dispatcher->trigger_event('core.index_modi...', Array) #10 {main} thrown in /home/web3xp3r4/html/phpBB3/phpbb/db/driver/mysqli.php on line 281
can you clear phpbb cache and do ctrl-shift f5 to clear browser cache aswell ?
Both done. resulting in the errors above. Cleared cache in the backend and deleted the "production" folder within the cache. Also started my phpbb in a private session to make sure browser-cache is empty.
When I deactivate the recent topics extension than everything is fine with php8. Also switching back to php74 solves the issue -> extension is working there)
This is here is found im my error log (more or less the same as the browser shows, when accessing the board)
[05-Apr-2021 18:26:52 Europe/Berlin] PHP Fatal error: Uncaught TypeError: mysqli_data_seek(): Argument #2 ($offset) must be of type int, mysqli_result given in /home/web3xp3r4/html/phpBB3/phpbb/db/driver/mysqli.php:281
Stack trace:
#0 /home/web3xp3r4/html/phpBB3/phpbb/db/driver/mysqli.php(281): mysqli_data_seek(Object(mysqli_result), Object(mysqli_result))
#1 /home/web3xp3r4/html/phpBB3/phpbb/db/driver/driver.php(381): phpbb\db\driver\mysqli->sql_rowseek(Object(mysqli_result), Object(mysqli_result))
#2 /home/web3xp3r4/html/phpBB3/phpbb/db/driver/factory.php(297): phpbb\db\driver\driver->sql_fetchfield('topic_count', Object(mysqli_result), Object(mysqli_result))
#3 /home/web3xp3r4/html/phpBB3/ext/paybas/recenttopics/core/recenttopics.php(311): phpbb\db\driver\factory->sql_fetchfield('topic_count', Object(mysqli_result))
#4 /home/web3xp3r4/html/phpBB3/ext/paybas/recenttopics/event/listener.php(71): paybas\recenttopics\core\recenttopics->display_recent_topics()
#5 /home/web3xp3r4/html/phpBB3/vendor/symfony/event-dispatcher/EventDispatcher.php(214): paybas\recenttopics\event\listener->display_rt(Object(phpbb\event\data), 'core.index_modi...', Object(phpbb\event\dispatcher))
#6 /home/web3xp3r4/html/phpBB3/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'core.index_modi...', Object(phpbb\event\data))
#7 /home/web3xp3r4/html/phpBB3/phpbb/event/dispatcher.php(62): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('core.index_modi...', Object(phpbb\event\data))
#8 /home/web3xp3r4/html/phpBB3/phpbb/event/dispatcher.php(46): phpbb\event\dispatcher->dispatch('core.index_modi...', Object(phpbb\event\data))
#9 /home/web3xp3r4/html/phpBB3/index.php(244): phpbb\event\dispatcher->trigger_event('core.index_modi...', Array)
#10 {main}
thrown in /home/web3xp3r4/html/phpBB3/phpbb/db/driver/mysqli.php on line 281
check line 477 of paybas\recenttopics\core\recenttopics.php
there should only be one argument.
$num_rows = (int) $this->db->sql_fetchfield('topic_count');
jepp, this is identical. I deleted the whole recenttopics-folder and replaced all files with the latest versions from github.
Has anyone tried the patches I posted on the phpbb forum ?