Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-17436

PHP fatal error while converting from phpBB 2.0 with Attachment MOD

XMLWordPrintable

      Discussion: https://www.phpbb.com/community/viewtopic.php?t=2658115

      Conversion from phpBB 2.0 with Attachment MOD installed may cause PHP fatal error like:

       

      Fatal error: Uncaught TypeError: mysqli_fetch_assoc(): Argument #1 ($result) must be of type mysqli_result, bool given in C:\ProgramFiles\laragon\www\phpbb\phpbb\db\driver\mysqli.php:276 
       
      Stack trace: 
      #0 C:\ProgramFiles\laragon\www\phpbb\phpbb\db\driver\mysqli.php(276): mysqli_fetch_assoc(true) 
      #1 C:\ProgramFiles\laragon\www\phpbb\phpbb\db\driver\driver.php(389): phpbb\db\driver\mysqli->sql_fetchrow(true) 
      #2 C:\ProgramFiles\laragon\www\phpbb\install\convertors\functions_phpbb20.php(1421): phpbb\db\driver\driver->sql_fetchfield('lang_dir') 
      #3 C:\ProgramFiles\laragon\www\phpbb\install\convert\convertor.php(1121) : eval()'d code(2): phpbb_attachment_extension_group_name() 
      #4 C:\ProgramFiles\laragon\www\phpbb\install\convert\convertor.php(1121): eval() 
      #5 C:\ProgramFiles\laragon\www\phpbb\install\convert\convertor.php(252): phpbb\convert\convertor->jump('phpbb20', 1, 3) 
      #6 C:\ProgramFiles\laragon\www\phpbb\install\convert\controller\convertor.php(370): phpbb\convert\convertor->convert_data('phpbb20') 
      #7 C:\ProgramFiles\laragon\www\phpbb\vendor\symfony\http-kernel\HttpKernel.php(151): phpbb\convert\controller\convertor->convert('phpbb20') 
      #8 C:\ProgramFiles\laragon\www\phpbb\vendor\symfony\http-kernel\HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(phpbb\symfony_request), 1) 
      #9 C:\ProgramFiles\laragon\www\phpbb\install\app.php(61): Symfony\Component\HttpKernel\HttpKernel->handle(Object(phpbb\symfony_request)) 
      #10 {main} thrown in C:\ProgramFiles\laragon\www\phpbb\phpbb\db\driver\mysqli.php on line 276

      The bug is in \install\convertors\functions_phpbb20.php, function phpbb_attachment_extension_group_name(), where sql_fetchfield() is used to iterate through SELECT query results in a 'while' loop. sql_fetchfield() implicitly uses current query_id which is getting changed to boolean (true) by UPDATE query result inside the 'while' loop, which leads to the error mentioned.

       

            Marc Marc
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: