Ultimate SEO Urls

Use of undefined constant - Ultimate SEO Urls

Use of undefined constant

by mhsuffolk » Sun Apr 09, 2023 6:51 am

Phoenix 1.0.8.19 USU 3.0.7 PHP 7.4
Getting a lot of:
PHP Warning: Use of undefined constant SID - assumed 'SID' (this will throw an Error in a future version of PHP) in /home/****/public_html/includes/classes/usu_init.php on line 36
Live shop Phoenix 1.0.9.0 on PHP 8.0
User avatar
mhsuffolk
VIP Member
VIP Member
Posts: 146
Joined: Sat Oct 26, 2019 9:13 am
Contact:

Re: Use of undefined constant

by Omar_one » Thu Apr 13, 2023 6:39 pm

try to change line 36
to

Code: Select all

->setVar( 'sid', 'SID' ) // cambio 1.0.8.19
Omar_one
VIP Member
VIP Member
Posts: 481
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: Use of undefined constant

by mhsuffolk » Fri Apr 14, 2023 7:10 am

Omar_one wrote:try to change line 36
to

Code: Select all

->setVar( 'sid', 'SID' ) // cambio 1.0.8.19
Thank you for the suggestion. Unfortunately this adds SID=&SID to the end of every rewritten URL
Live shop Phoenix 1.0.9.0 on PHP 8.0
User avatar
mhsuffolk
VIP Member
VIP Member
Posts: 146
Joined: Sat Oct 26, 2019 9:13 am
Contact:

Re: Use of undefined constant

by mhsuffolk » Tue Apr 18, 2023 2:48 pm

Solved it.
I am unsure if it is correct but the addon still works and the error has gone.

Code: Select all

->setVar( 'sid', $GLOBALS['SID'] ) // MH change
Live shop Phoenix 1.0.9.0 on PHP 8.0
User avatar
mhsuffolk
VIP Member
VIP Member
Posts: 146
Joined: Sat Oct 26, 2019 9:13 am
Contact:

Re: Use of undefined constant

by mhsuffolk » Tue Apr 18, 2023 3:57 pm

mhsuffolk wrote:Solved it.
I am unsure if it is correct but the addon still works and the error has gone.

Code: Select all

->setVar( 'sid', $GLOBALS['SID'] ) // MH change
Spoke too soon. Shop side (where the error was showing) is OK but when I access the USU admin I get this in the admin error log.

Code: Select all

PHP Notice:  Undefined index: SID in /home/****/public_html/includes/classes/usu_init.php on line 36
Live shop Phoenix 1.0.9.0 on PHP 8.0
User avatar
mhsuffolk
VIP Member
VIP Member
Posts: 146
Joined: Sat Oct 26, 2019 9:13 am
Contact:

Re: Use of undefined constant

by Piernas » Thu Apr 20, 2023 7:12 am

For me it's working fine. Anyone else experiencing this?

Anyway this should fix it:

Code: Select all

                     ->setVar( 'sid', defined('SID') ? SID : '' )
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact:

Re: Use of undefined constant

by mhsuffolk » Thu Apr 20, 2023 7:51 am

Piernas wrote:For me it's working fine. Anyone else experiencing this?

Anyway this should fix it:

Code: Select all

                     ->setVar( 'sid', defined('SID') ? SID : '' )
Thank you so much, all errors gone now.
Live shop Phoenix 1.0.9.0 on PHP 8.0
User avatar
mhsuffolk
VIP Member
VIP Member
Posts: 146
Joined: Sat Oct 26, 2019 9:13 am
Contact:

Re: Use of undefined constant

by user57345930 » Mon Apr 24, 2023 2:54 pm

Piernas wrote:For me it's working fine. Anyone else experiencing this?

Anyway this should fix it:

Code: Select all

                     ->setVar( 'sid', defined('SID') ? SID : '' )
I have the same problem but with this edit nothing change... any fix? Thanks
user57345930
Posts: 8
Joined: Sat Apr 22, 2023 11:18 am
Contact:

Re: Use of undefined constant

by Piernas » Wed Apr 26, 2023 1:08 am

user57345930 wrote:I have the same problem but with this edit nothing change... any fix? Thanks
Please post your related log lines
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact: