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

SolusVM: Making service changes results in an exception PHP 8

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.10.2
    • Fix Version/s: 5.10.3, 5.11.0
    • Component/s: Modules
    • Labels:
      None

      Description

      Appears to work on PHP 7.4, but returns this error on PHP 8.1 and 8.2

      A white screen is encountered when making changes to a SolusVM service. It appears to happen when a cron runs for pending service changes (upgrade/downgrade) but the same error occurs when simply setting an override price, even with "Use Module" unchecked.

      To reproduce:

      1. Edit a SolusVM service
      2. Check "Override Price", set a new price and uncheck "Use Module"
      3. Save

      Note the white screen, and the following error in ../logs_blesta/ logs

      [2024-10-10T15:54:23.238925+00:00] general.ERROR: Uncaught Exception TypeError: "array_key_exists(): Argument #2 ($array) must be of type array, stdClass given" at /home/user/public_html/511dev/components/modules/solusvm/solusvm.php line 451

      Unknown macro: {"exception"}

        Activity

        Hide
        admin Paul Phillips added a comment -

        In components/modules/solusvm.php around line 451 change
        if (!array_key_exists($key, $service_fields) || $vars[$key] != $service_fields->$key) {

        To
        if (!property_exists($service_fields, $key) || $vars[$key] != $service_fields->$key) {

        Show
        admin Paul Phillips added a comment - In components/modules/solusvm.php around line 451 change if (!array_key_exists($key, $service_fields) || $vars [$key] != $service_fields->$key) { To if (!property_exists($service_fields, $key) || $vars [$key] != $service_fields->$key) {

          People

          • Assignee:
            abdy Abdy Franco
            Reporter:
            admin Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              22/Oct/24

              Time Tracking

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