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

Order: Domain forms don't display tlds from restricted packages

    Details

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

      Description

      To reproduce:

      • Create a regular domain package for a registrar
      • Create a restricted domain package for a registrar with different TLDs in the same package group
      • Create a domain order form using the package group
      • Give a client access to the restricted package
      • View the order form as that client
      • See that the TLDs from the restricted package are not shown

      To resolve change lib/order_types/domain/order_type_domain.php in getTlds():

              if (!isset($this->Packages)) {
                  Loader::loadModels($this, ['Packages']);
              }
      

      To:

              if (!isset($this->Packages)) {
                  Loader::loadModels($this, ['Packages']);
              }
              if (!isset($this->Clients)) {
                  Loader::loadModels($this, ['Clients']);
              }
              if (!isset($this->Session)) {
                  Loader::loadComponents($this, ['Session']);
              }
      

      And also in getTlds() change:

              foreach ($packages[$group->package_group_id] as $package) {
                  $package = $this->Packages->get($package->id);
      
                  if ($package && $package->status == 'active' && isset($package->meta->tlds)) {
                      foreach ($package->meta->tlds as $tld) {
                          if (isset($tlds[$tld])) {
                              continue;
                          }
      
                          $tlds[$tld] = [$package, $group];
                      }
                  }
              }
      

      To:

              foreach (
                  $this->Clients->getRestrictedPackages($this->Session->read('blesta_client_id')) as $client_package
              ) {
                  $package = $this->Packages->get($client_package->package_id);
                  foreach ($package->groups as $package_group) {
                      if ($package_group->id == $group->package_group_id && isset($package->meta->tlds)) {
                          foreach ($package->meta->tlds as $tld) {
                              if (isset($tlds[$tld])) {
                                  continue;
                              }
      
                              $tlds[$tld] = [$package, $group];
                          }
      
                          break;
                      }
                  }
              }
      
              foreach ($packages[$group->package_group_id] as $package) {
                  $package = $this->Packages->get($package->id);
      
                  if ($package && $package->status == 'active' && isset($package->meta->tlds)) {
                      foreach ($package->meta->tlds as $tld) {
                          if (isset($tlds[$tld])) {
                              continue;
                          }
      
                          $tlds[$tld] = [$package, $group];
                      }
                  }
              }
      

        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:
              8/Jun/21

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 13 minutes
              13m

                Agile