-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the installer/upgrader #7849
Fix the installer/upgrader #7849
Conversation
I'm on a linux os and its case sensitive:
As well, all I did so far is copy my 2.1 forum into a new database and directory, then uploaded the 3.0 files. |
I haven't tested yet, but it looks good to the eye. One request: please change the name of the method to something more descriptive, such as |
Done. I've also included some other fixes that I needed to get the ugprade.php to run. |
Nice. I will look forward to testing as soon as I can. It might take me a little to get to it, though; this week is going to be a very busy one for me. Of course, someone else can always test and approve instead. |
Added fixes for #7852 |
Conflicts need to be fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran into problems due to typos when testing the installer.
After correcting the typos in my local test copy, I then received this error during step 2 of the install:
Fatal error: Uncaught TypeError: mysqli_query(): Argument #1 ($mysql) must be of type mysqli, null given in /Users/jon/Sites/temp/Sources/Db/APIs/MySQL.php:237 Stack trace: #0 /Users/jon/Sites/temp/Sources/Db/APIs/MySQL.php(237): mysqli_query(NULL, '\n\t\t\tSELECT VERS...', 0) #1 /Users/jon/Sites/temp/Sources/Db/APIs/MySQL.php(1066): SMF\Db\APIs\MySQL->query('', '\n\t\t\tSELECT VERS...', Array) #2 /Users/jon/Sites/temp/Sources/Db/APIs/MySQL.php(1933): SMF\Db\APIs\MySQL->get_version() #3 /Users/jon/Sites/temp/Sources/Db/DatabaseApi.php(334): SMF\Db\APIs\MySQL->__construct(Array) #4 /Users/jon/Sites/temp/install.php(882): SMF\Db\DatabaseApi::load(Array) #5 /Users/jon/Sites/temp/install.php(178): DatabaseSettings() #6 {main} thrown in /Users/jon/Sites/temp/Sources/Db/APIs/MySQL.php on line 237
I have not tried to investigate that error further.
I can't get your error to occur. But that sounds like a mysql error occurred, most likely in the database connection since mysqli param should be the connection resource. I'm even more certain seeing the stacktrace shows myqi_query first param is null. The connection failed but it continued. Need to investigate to ensure that the installer does not allow/try to continue if the database connection fails. |
Just as a FYI, I ran the install late last night. Windows 10, php 8.2, 10.10.2-MariaDB I did not tie it to an existing DB. Install ran without issue. |
See my earlier note about case sensitivity. Windows won't see this issue. Only linux/unix based oses. |
I saw it, I was just confirming it runs in windows and providing what its running on ;) |
ee4d909
to
e242dc3
Compare
ecab000
to
4bd7b43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely for me. :)
This is occuring because
$modSettings['rand_seed']
is not set. All of$modSettings
is not set, besides the default theme that gets set later in upgrade.phpThis logic is called by this in ugprade.php
We only reload the data when ssi is in the url, so this will always reseed the settings every time.
Note also prior to this we call loadEssentialData, which also attempts to make use of $modSettings.
Well digging back further I locate this call:
Change that over to a die and..
It can't find it because in my Settings.php,
$db_type = 'mysql';
To work around this, added a helper method in DatabaseApi to determine the type based on the passed type. Choose to pass a type so we can always get back a result even for other database types.
This also does fix the seed issue since the database is now able to connect.