FOSSBilling / FOSSBilling

Empower your hosting business with FOSSBilling, the free and open-source solution for efficient billing and client management.
https://fossbilling.org
Apache License 2.0
762 stars 165 forks source link

[Bug] Currency system doesn't correctly handle removing and changing the default #582

Open openpars opened 1 year ago

openpars commented 1 year ago

Hello I just finished installing FOSSBilling on my shared hosting. After adding a new currency and removing default US Dollar currency I got this error message on client side when I click order link.

An exception has been thrown during the rendering of a template ("Model not found").

Here is the last error log

[12-Dec-2022 17:48:56 UTC] An exception has been thrown during the rendering of a template ("Model not found").
[12-Dec-2022 17:49:29 UTC] An exception has been thrown. Stacktrace:
[12-Dec-2022 17:49:29 UTC] /library/Box/Database.php:182 - __construct(Model not found)
/modules/Cart/Service.php:321 - getExistingModelById(Currency, 1)
/modules/Cart/Api/Guest.php:33 - toApiArray()
/library/Api/Handler.php:116 - get()
/vendor/twig/twig/src/Extension/CoreExtension.php:1607 - __call(cart_get, )
/data/cache/4d/4da277dc1c03fa03433f4035b2361266001a69b25df3d68029760cfd21a37ee9.php:37 - twig_get_attribute(, , , cart_get, , any, , , , )
/vendor/twig/twig/src/Template.php:394 - doDisplay(, )
/vendor/twig/twig/src/Template.php:367 - displayWithErrorHandling(, )
/data/cache/34/3480eb3c00f176c1656cc6e9f2e4f0140f79fb452be6399f51a1f8342942b94b.php:159 - display()
/vendor/twig/twig/src/Template.php:394 - doDisplay(, )
/vendor/twig/twig/src/Template.php:367 - displayWithErrorHandling(, )
/vendor/twig/twig/src/Template.php:379 - display()
/vendor/twig/twig/src/TemplateWrapper.php:40 - render(, )
/library/Box/AppClient.php:84 - render()
/modules/Orderbutton/Controller/Client.php:47 - render(mod_orderbutton_index)
NO_FILE:NO_LINE - get_index()
/library/Box/App.php:217 - invokeArgs(, )
/library/Box/App.php:370 - executeShared(Box\Mod\Orderbutton\Controller\Client, get_index, )
/library/Box/App.php:158 - processRequest()
/index.php:30 - run()

[12-Dec-2022 17:49:29 UTC] An exception has been thrown during the rendering of a template ("Model not found").

I tried to restore US Dollar currency but no luck. Can you please help me?

BelleNottelling commented 1 year ago

Hello, @openpars Sorry for the delayed response. This is a known issue, but it's not one we've had the chance to fix yet. In 0.2.4 you'll be able to set the currency during installation, but for now what you can do as a workaround is to open your SQL database, find the currency table, and the edit the currency you added to change the id to 1. As long as no purchases were made with the USD currency, this shouldn't cause any issues.

jaapmarcus commented 1 year ago

During the install users have the option to change it to a different currency but the issue remains the same