You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
In the control panel, selecting preview for an email template for orders will result in an error as PostgresSql does not have a Rand() function.
To Reproduce
How, and what happened?
Go to emails
Attempt to preview one on a site using postgres
Expected behavior
The preview would open and the email would be displayed using an order
Additional info
Craft version: Craft Pro 3.5.6
Commerce version: 3.2.3
PHP version: 7.3.17
Database driver & version: PostgreSQL 12.2
Additional context
The issue is in the preview set up, specifically in vendor/craftcms/commerce/src/controllers/EmailsController.php at line 49– craft\elements\db\ElementQuery::one() at line 49 $order = Order::find()->isCompleted(true)->orderBy('RAND()')->one();
That RAND() call will not work with a Postgres database, it has the order by function of random() instead.
The text was updated successfully, but these errors were encountered:
Description
In the control panel, selecting preview for an email template for orders will result in an error as PostgresSql does not have a Rand() function.
To Reproduce
How, and what happened?
Expected behavior
The preview would open and the email would be displayed using an order
Additional info
Additional context
The issue is in the preview set up, specifically in
vendor/craftcms/commerce/src/controllers/EmailsController.php at line 49– craft\elements\db\ElementQuery::one()
at line 49$order = Order::find()->isCompleted(true)->orderBy('RAND()')->one();
That RAND() call will not work with a Postgres database, it has the order by function of random() instead.
The text was updated successfully, but these errors were encountered: