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

        jonathan Jonathan Reissmueller created issue -
        jonathan Jonathan Reissmueller made changes -
        Field Original Value New Value
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Fix Version/s 4.11.0-b2 [ 11503 ]
        Fix Version/s 4.12.0-b1 [ 11502 ]
        jonathan Jonathan Reissmueller made changes -
        Sprint 4.12.0 Sprint 1 [ 113 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked lower
        abdy Abdy Franco made changes -
        Assignee Abdy Franco [ abdy ]
        Automated transition triggered when Abdy Franco created a branch in Stash -
        Status Open [ 1 ] In Progress [ 3 ]
        Automated transition triggered when Abdy Franco created pull request #30 in Stash -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        abdy Abdy Franco made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 12 minutes [ 720 ]
        Worklog Id 13878 [ 13878 ]
        Automated transition triggered when Jonathan Reissmueller merged pull request #30 in Stash -
        Status In Review [ 5 ] Closed [ 6 ]
        jonathan Jonathan Reissmueller made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        jonathan Jonathan Reissmueller made changes -
        Fix Version/s 4.10.3 [ 11504 ]
        Automated transition triggered when Abdy Franco created pull request #31 in Stash -
        Status Reopened [ 4 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        Automated transition triggered when Jonathan Reissmueller merged pull request #31 in Stash -
        Status In Review [ 5 ] Closed [ 6 ]

          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