Closed eSilverStrike closed 2 years ago
@mystralkk
In lib-common I notice in the 2 spots the IP class is initialized you do not do it when the install is running
if (!defined('GL_INSTALL_ACTIVE')) {
\Geeklog\IP::init($_TABLES['ip_addresses'], $_CONF['ip_anonymization']);
}
When I remove the if statement and allow the IP class to be initialized even if the install is running (and I also remove the setting of the table in the IP class to "gl_ip_addresses"), everything seems to run fine with no errors. In fact this also fixes the issue with the session record pointing to an ip address that is blank.
I tested it without problems on a new install, upgrading from 2.2.1, and migrating from a 2.0.0 database.
I believe you added the IP class in 2.2.0 so it seems to run fine with a DB that existed before the class as well.
Can you think of the reason you prevented the IP class from initializing during the install? (maybe you can test the fix as well)
If not I will update lib-common and IP class.
Can you think of the reason you prevented the IP class from initializing during the install? (maybe you can test the fix as well)
No, I don't remember why I stopped initializing the IP class during installation.
If not I will update lib-common and IP class.
Please go ahead.
Okay it is done.
This issue happens when upgrading or migrating Geeklog.net.
Geeklog.net doesn't use any database table prefix (like 'gl_') so the Ip class fails as when it initializes, it assumes a table name of 'gl_ip_addresses'. It should be just 'ip_addresses'.
This issue also relates to #1127 as you can see it is intserting a record without an actual IP Address.
The only thing I see not working is once the install, upgrade, or migrate is complete and the user is on the success page of the install the IP Address for the session is a blank for some reason. This will remain a blank until that user session logs into Geeklog. If other anonymous users visit from a different browser things work fine.