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

cPanel: Possible error when viewing client service stats tab

    Details

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

      Description

      We received this report from a customer

      When a cPanel account has a bandwidth limit set to 'unlimited' the cPanel module returns a PHP error of:

      A non-numeric value encountered on line 1634 in components/modules/cpanel/cpanel.php
      This is an error that prevents the a customer facing page: clients/services/manage/2/tabClientStats/ from loading. The following has worked for my use cases.

      diff --git a/components/modules/cpanel/cpanel.php b/components/modules/cpanel/cpanel.php
      index ddbca45..504cb42 100644

      --- a/components/modules/cpanel/cpanel.php
      +++ b/components/modules/cpanel/cpanel.php
      @@ -1626,7 +1626,7 @@ class Cpanel extends Module
      
                   if (isset($bw->bandwidth[0]->acct[0])) {
                       $stats->bandwidth_usage['used'] = $bw->bandwidth[0]->acct[0]->totalbytes/(1024*1024);
      -                $stats->bandwidth_usage['limit'] = $bw->bandwidth[0]->acct[0]->limit/(1024*1024);
      +                $stats->bandwidth_usage['limit'] = is_numeric($bw->bandwidth[0]->acct[0]->limit) ? $bw->bandwidth[0]->acct[0]->limit/(1024*1024) : '';
                   }
      
                   if (isset($stats->account_info->acct[0])) {
      

      I was not able to reproduce this on our server, but since there is no harm in the proposed change it would be good to add it to resolve any potential errors for others.

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              29/Jul/20

              Time Tracking

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

                Agile