To reproduce:
- Add CWP module, server, and server group
- Create package with the server group
- Remove server from server group
- Assign the package to an order form
- Try to error the package and receive a fatal error
In the model OrderOrders::add() replace:
if (empty($service_ids)) {
return;
}
With
if (empty($service_ids)) {
if (($errors = $this->Services->errors())) {
$this->Input->setErrors($errors);
}
return;
}
Update the controller Checkout::createOrder() method replace:
$presenter = $this->Invoices->getPresenter($order->invoice_id);
$collection = $presenter->collection();
$affiliate_code = isset($_COOKIE['affiliate_code']) ? $_COOKIE['affiliate_code'] : null;
if (!empty($order) && !empty($affiliate_code)) {
with
$affiliate_code = isset($_COOKIE['affiliate_code']) ? $_COOKIE['affiliate_code'] : null;
if (!empty($order) && !empty($affiliate_code)) {
$presenter = $this->Invoices->getPresenter($order->invoice_id);
$collection = $presenter->collection();