Jump to content

Commerce store returning 500 error after forum upgrade


Go to solution Solved by Hazion,

Recommended Posts

Posted

I recently upgraded from 4.6.something to 4.7.4 and php 7.4 to php 8.1 while migrating my forum from one server to another.

I have the commerce application purchased and enabled, but ever since the migration/upgrade the store section of my forum hasn't worked (returns a 500 error - it worked before migrating/upgrading).

The following stack trace can be found in the system log when trying to navigate to the store (The URL of page the error occurred on was https://{forum}/forums/index.php?/store/):

TypeError: trim(): Argument #1 ($string) must be of type string, DateInterval given (0)
#0 /var/www/html/forums/system/Lang/Lang.php(1925): trim()
#1 [internal function]: IPS\_Lang->IPS\{closure}()
#2 /var/www/html/forums/system/Lang/Lang.php(1929): array_map()
#3 /var/www/html/forums/system/Lang/Lang.php(1713): IPS\_Lang->replaceWords()
#4 /var/www/html/forums/system/Output/Output.php(820): IPS\_Lang->parseOutputForDisplay()
#5 /var/www/html/forums/system/Dispatcher/Dispatcher.php(173): IPS\_Output->sendOutput()
#6 /var/www/html/forums/system/Dispatcher/Standard.php(113): IPS\_Dispatcher->finish()
#7 /var/www/html/forums/system/Dispatcher/Front.php(558): IPS\Dispatcher\_Standard->finish()
#8 /var/www/html/forums/system/Dispatcher/Dispatcher.php(155): IPS\Dispatcher\_Front->finish()
#9 /var/www/html/forums/index.php(13): IPS\_Dispatcher->run()
#10 {main}

It should be noted that I am able to access the "Manage purchases" and "Orders" tabs just fine.

The "Subscriptions" page partially works, but it only lists the first subscription and it says "Price unavailable" instead of the price. When trying to order the subscription, I get sent to a page displaying the following error:

TypeError: IPS\nexus\Invoice\_Item::__construct(): Argument #2 ($price) must be of type IPS\nexus\Money, null given, called in /var/www/html/forums/applications/nexus/modules/front/subscriptions/subscriptions.php on line 209 (0)
#0 /var/www/html/forums/applications/nexus/modules/front/subscriptions/subscriptions.php(209): IPS\nexus\Invoice\_Item->__construct()
#1 /var/www/html/forums/system/Dispatcher/Controller.php(107): IPS\nexus\modules\front\subscriptions\_subscriptions->purchase()
#2 /var/www/html/forums/applications/nexus/modules/front/subscriptions/subscriptions.php(52): IPS\Dispatcher\_Controller->execute()
#3 /var/www/html/forums/system/Dispatcher/Dispatcher.php(153): IPS\nexus\modules\front\subscriptions\_subscriptions->execute()
#4 /var/www/html/forums/index.php(13): IPS\_Dispatcher->run()
#5 {main}

 

Posted

We would need to look further into this for you, however the access details on file appear to be incorrect or missing. Could you please update these details by visiting your client area, selecting the relevant purchase, then clicking "Review/Update Access Information" under the "Stored Access Information" section. 

We look forward to further assisting you. 

 

Posted
6 hours ago, Jim M said:

We would need to look further into this for you, however the access details on file appear to be incorrect or missing. Could you please update these details by visiting your client area, selecting the relevant purchase, then clicking "Review/Update Access Information" under the "Stored Access Information" section. 

We look forward to further assisting you. 

 

Thanks, I've updated the access information.

  • Solution
Posted

Update: I fixed the issue myself by adding the following code above the error-causing line (1929 in Lang.php):

if (is_a($val, 'DateInterval')) 
{
	return 'month';
}

Regardless, thank you for replying :happy:

Posted

We wouldnt usually advise on updating files yourself, as it may cause you issues down the line. Of course if you have updated it yourself, you will need to update that file on every update, and of course it means the core issue is never actually being resolved on your system. If you would like for us to take a closer look at what is causing the actual problem, please let us know.

Posted
1 hour ago, MediaDIGI.com said:

When there would be a code update that will fix this issue because I also have it https://topgoldforum.com/store/

There would not be as the OP has chosen to resolve it themselves rather than let us investigate. If you would like us to investigate your issue, please do the following:

We would need to look further into this for you, however the access details on file appear to be incorrect or missing. Could you please update these details by visiting your client area, selecting the relevant purchase, then clicking "Review/Update Access Information" under the "Stored Access Information" section. 

We look forward to further assisting you. 

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...