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

cPanel: Client stats do not load on PHP 8.1

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.9.3
    • Fix Version/s: 5.10.0-b2
    • Component/s: Client Interface, Modules
    • Labels:
      None

      Description

      In the cPanel module, on PHP 8.1, the service management stats page does not load the stats, and results in the following PHP error being logged:

      Uncaught TypeError, code 0 in /components/modules/cpanel/views/default/tab_client_stats.pdt on line 36 Message: round(): Argument #1 ($num) must be of type int|float, string given

      More information provided by the client:

      tab_client_stats.pdt#35
      'limit' => round(($stats->disk_usage['limit']) ?? 0, 2)
      Limit in this case is empty which ends up getting passed in to round and
      throughs that error.
      Looks like on php 7 it just converted to zero but doesn't happen on 8

        Activity

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/May/24

              Time Tracking

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

                Agile