3.2.2 Update Problem updating database (& 3.2.3) SOLVED

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
mameaddicts
Registered User
Posts: 12
Joined: Fri Feb 02, 2018 9:42 pm

Re: 3.2.2 Update Problem with updating database

Post by mameaddicts » Sat Feb 03, 2018 5:15 am

3.2.2 upgrade is a real pain. I see this error all over and no notable fix for a stable release?

User avatar
Lumpy Burgertushie
Registered User
Posts: 65175
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: 3.2.2 Update Problem with updating database

Post by Lumpy Burgertushie » Sat Feb 03, 2018 6:32 pm

let's get the terminology straight first.

3.1.X to 3.2.x is an upgrade
this requires complete file replacement(except for config.php file ) and database update

3.2.x to 3.2.x is an update
it also usually requires complete file replacement(except for config.php file ) and database update

since 3.1 came out using extensions rather than MODs, there is rarely a reason to use the auto update method of updates.
if you have not altered the standard code of the software then there is no reason to use the autoupdate. It was only used when the code had been edited.

having said all that, there are some bugs in the current 3.2.1 to 3.2.2 update that require making some changes to get it to work right.
or, you can simply wait until the 3.2.3 update comes out before you update.

if you are changing your php version to 7.x then you do need to change your config.php file from mysql to mysqli since the new php version has deprecated mysql.

hopes this helps clear some of this up for you.

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

sburns90
Registered User
Posts: 1
Joined: Tue Mar 13, 2018 7:24 pm

Re: 3.2.2 Update Problem with updating database

Post by sburns90 » Tue Mar 13, 2018 7:39 pm

SOLVED:

PROBLEM:

I had the same problem related to

Code: Select all

SQL ERROR [ mysqli ] [0]SQL No values specified for SQL IN comparison in file [ROOT]/phpbb/db/driver/driver.php on line 996

SOLUTION:

TLDR;
Go into a MySQL command line:
EXECUTE THE FOLLOWING CODE. BUT CHANGE 'YourDBname' to your actual database name.

Code: Select all

UPDATE YourDBname.phpbb_styles SET style_active = '1' WHERE style_id = '1';
Then re-run your database upgrade process.


Long Answer:

The solution was given in the backtrace.

Code: Select all

FILE: [ROOT]/phpbb/db/migration/data/v32x/fix_user_styles.php
LINE: 48
CALL: phpbb\db\driver\factory->sql_in_set()

FILE: (not given by php)
LINE: (not given by php)
CALL: phpbb\db\migration\data\v32x\fix_user_styles->styles_fix()
If you look at the file: fix_user_styles.php

Code: Select all

<? php >

class fix_user_styles extends \phpbb\db\migration\migration
{

        static public function depends_on()
        {
                return array(
                        '\phpbb\db\migration\data\v320\v320',
                );
        }

        public function update_data()
        {
                return array(
                        array('custom', array(array($this, 'styles_fix'))),
                );
        }

        public function styles_fix()
        {
                $default_style = (int) $this->config['default_style'];

                // Get enabled styles
                $sql = 'SELECT style_id
                        FROM ' . STYLES_TABLE . '
                        WHERE style_active = 1';
                $result = $this->db->sql_query($sql);
                $enabled_styles = $result->fetch_array();
                $this->db->sql_freeresult($result);

                // Set the default style to users who have an invalid style
                $this->sql_query('UPDATE ' . USERS_TABLE . '
                        SET user_style = ' . (int) $default_style . '
                        WHERE ' . $this->db->sql_in_set('user_style', $enabled_styles, true));
        }
}
<? /php >
The key line is:

Code: Select all

WHERE ' . $this->db->sql_in_set('user_style', $enabled_styles, true));
So this tells us that the problem is located in the DB table and that it is looking for active styles.
You can confirm this problem by running this code from a MySQL command line:

Code: Select all

SELECT * FROM phpbb_styles WHERE style_active = 1;
If NOTHING shows up then there are NO active styles.

To fix this simply active a style:

Code: Select all

UPDATE YourDBname.phpbb_styles SET style_active = '1' WHERE style_id = '1';
Hope this helps anyone else with this problem.

- Steve

kholman
Registered User
Posts: 66
Joined: Sun Jan 16, 2005 12:35 am
Location: Maryland USA
Contact:

Re: 3.2.2 Update Problem with updating database

Post by kholman » Thu Nov 08, 2018 3:10 am

I had put this aside and figured to just wait for the 3.2.3 update and the problem reappeared.

Steve (@sburns90) had my solution but I had to go "around the barn" to implement.

Following the trail he left for us, I went into the ACP Styles menu. I only have one installed style (prosilver) but it wasn't "activated". I did that from the ACP and then the update ran as expected.

Thanks to him for the solution.

User avatar
david63
Jr. Extension Validator
Posts: 14898
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: 3.2.2 Update Problem updating database (& 3.2.3) SOLVED

Post by david63 » Thu Nov 08, 2018 7:05 am

kholman wrote:
Thu Nov 08, 2018 3:10 am
I only have one installed style (prosilver) but it wasn't "activated".
Not sure how you managed to do that as you have to have at least one style activated otherwise your board will not run.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: Affin, Ajaz, fred8615, janus_zonstraal, KevC, sean_lemieux, stevemaury and 41 guests