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
Orders won't show validation errors in the CP because you don't grab the Element from route params but fetch them again from the DB thus validation errors won't be rendered. I made a custom field that needs to be filled in a certain way and while my errors are displayed in the fronend, nothing is shown in the CP. Are there any reasons why you don't show validation errors?
Steps to reproduce
Create a field
Add the field with certain validation rules in the layout to the Order
publicfunction actionEditOrder($orderId, Order$order = null): Response
{
$plugin = Plugin::getInstance();
$variables = [
'orderId' => $orderId,
'order' => $order, <-- set the order from route variables
'orderSettings' => $plugin->getOrderSettings()->getOrderSettingByHandle('order')
];
Then you need to fix the following bug as well in OrdersController line 454
Since these lines are never called (because there is no reason there is an error) they can't throw an exception.
if ($variables['order']->getErrors($field->getField()->handle)) {
must be
if ($variables['order']->getErrors($field->handle)) {
The text was updated successfully, but these errors were encountered:
Description
Orders won't show validation errors in the CP because you don't grab the Element from route params but fetch them again from the DB thus validation errors won't be rendered. I made a custom field that needs to be filled in a certain way and while my errors are displayed in the fronend, nothing is shown in the CP. Are there any reasons why you don't show validation errors?
Steps to reproduce
Steps to solve
Change the line here OrderController::actionEditOrder
from
to
Then you need to fix the following bug as well in OrdersController line 454
Since these lines are never called (because there is no reason there is an error) they can't throw an exception.
must be
The text was updated successfully, but these errors were encountered: