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

Domain Manager: Expiration notice is based on renew date instead of expiration

    Details

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

      Description

      The issue is clearly seen in the code. We fetch services based on renewal date (see plugins/domains/domains_plugin.php around line 1258).

      Potential solution: Update plugins/domains/domains_plugin.php around line 1258 from

                  $services = $this->Services->getAll(
                      ['date_added' => 'DESC'],
                      true,
                      [],
                      [
                          'services' => [
                              'package_group_id' => $settings['domains_package_group'],
                              ['column' => 'date_renews', 'operator' => '>=', 'value' => $start_date],
                              ['column' => 'date_renews', 'operator' => '<=', 'value' => $end_date]
                          ]
                      ]
                  );
      

      To

                  $domains = $this->Record->select()->
                      from('domains_domains')->
                      where('expiration_date', '>=', $start_date)->
                      where('expiration_date', '<=', $end_date)->
                      fetchAll();
                  $service_ids = array_values($this->Form->collapseObjectArray($domains, 'service_id', 'service_id'));
      
                  // Fetch all qualifying services
                  $services = [];
                  if (!empty($service_ids)) {
                      $services = $this->Services->getAll(
                          ['date_added' => 'DESC'],
                          true,
                          [],
                          [
                              'services' => [
                                  'package_group_id' => $settings['domains_package_group'],
                                  ['column' => 'id', 'operator' => 'in', 'value' => $service_ids]
                              ]
                          ]
                      );
                  }
      

        Activity

        jonathan Jonathan Reissmueller created issue -
        jonathan Jonathan Reissmueller made changes -
        Field Original Value New Value
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.6.0-b1 Sprint x [ 170 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Description The issue is clearly seen in the code. We fetch services based on renewal date (see plugins/domains/domains_plugin.php around line 1294).

        Potential solution: Update plugins/domains/domains_plugin.php around line 1258 from

        {code:java}
                    $services = $this->Services->getAll(
                        ['date_added' => 'DESC'],
                        true,
                        [],
                        [
                            'services' => [
                                'package_group_id' => $settings['domains_package_group'],
                                ['column' => 'date_renews', 'operator' => '>=', 'value' => $start_date],
                                ['column' => 'date_renews', 'operator' => '<=', 'value' => $end_date]
                            ]
                        ]
                    );
        {code}

        To

        {code:java}
                    $domains = $this->Record->select()->
                        from('domains_domains')->
                        where('expiration_date', '>=', $start_date)->
                        where('expiration_date', '<=', $end_date)->
                        fetchAll();
                    $service_ids = array_values($this->Form->collapseObjectArray($domains, 'service_id', 'service_id'));

                    // Fetch all qualifying services
                    $services = [];
                    if (!empty($service_ids)) {
                        $services = $this->Services->getAll(
                            ['date_added' => 'DESC'],
                            true,
                            [],
                            [
                                'services' => [
                                    'package_group_id' => $settings['domains_package_group'],
                                    ['column' => 'id', 'operator' => 'in', 'value' => $service_ids]
                                ]
                            ]
                        );
                    }
        {code}
        The issue is clearly seen in the code. We fetch services based on renewal date (see plugins/domains/domains_plugin.php around line 1258).

        Potential solution: Update plugins/domains/domains_plugin.php around line 1258 from

        {code:java}
                    $services = $this->Services->getAll(
                        ['date_added' => 'DESC'],
                        true,
                        [],
                        [
                            'services' => [
                                'package_group_id' => $settings['domains_package_group'],
                                ['column' => 'date_renews', 'operator' => '>=', 'value' => $start_date],
                                ['column' => 'date_renews', 'operator' => '<=', 'value' => $end_date]
                            ]
                        ]
                    );
        {code}

        To

        {code:java}
                    $domains = $this->Record->select()->
                        from('domains_domains')->
                        where('expiration_date', '>=', $start_date)->
                        where('expiration_date', '<=', $end_date)->
                        fetchAll();
                    $service_ids = array_values($this->Form->collapseObjectArray($domains, 'service_id', 'service_id'));

                    // Fetch all qualifying services
                    $services = [];
                    if (!empty($service_ids)) {
                        $services = $this->Services->getAll(
                            ['date_added' => 'DESC'],
                            true,
                            [],
                            [
                                'services' => [
                                    'package_group_id' => $settings['domains_package_group'],
                                    ['column' => 'id', 'operator' => 'in', 'value' => $service_ids]
                                ]
                            ]
                        );
                    }
        {code}
        jonathan Jonathan Reissmueller made changes -
        Assignee Jonathan Reissmueller [ jonathan ]
        jonathan Jonathan Reissmueller made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        jonathan Jonathan Reissmueller made changes -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        abdy Abdy Franco made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 1 hour, 19 minutes [ 4740 ]
        Worklog Id 16044 [ 16044 ]
        abdy Abdy Franco made changes -
        Status In Review [ 5 ] Closed [ 6 ]

          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:
              15/Nov/22

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 hour, 19 minutes
              1h 19m

                Agile