Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-4209

Order: Order model doesn't report service creation errors

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.4
    • Component/s: None
    • Labels:
      None

      Description

      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:

              // Get invoice collection
              $presenter = $this->Invoices->getPresenter($order->invoice_id);
              $collection = $presenter->collection();
      
              // Add affiliate referral
              $affiliate_code = isset($_COOKIE['affiliate_code']) ? $_COOKIE['affiliate_code'] : null;
      
              if (!empty($order) && !empty($affiliate_code)) {
      

      with

              // Add affiliate referral
              $affiliate_code = isset($_COOKIE['affiliate_code']) ? $_COOKIE['affiliate_code'] : null;
      
              if (!empty($order) && !empty($affiliate_code)) {
                  // Get invoice collection
                  $presenter = $this->Invoices->getPresenter($order->invoice_id);
                  $collection = $presenter->collection();
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              5/Apr/21

              Agile