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

Universal Module: "count" on null value causes notice in php 7.2

    Details

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

      Description

      See https://www.blesta.com/forums/index.php?/topic/11884-blesta-error-reportingdebug-breaks-blesta/

      The following error can be encountered when attempting to use the Universal Module to add a new product on php 7.2:

      count(): Parameter must be an array or an object that implements Countable on line 45 in /components/modules/universal_module/views/default/add_row.pdt

      The fix is to update that add_row template (and the edit_row template) to ensura the argument is countable:

      $num_package_fields = count($this->Html->ifSet($vars->package_fields['label']));
      

      becomes

      $num_package_fields = count($this->Html->ifSet($vars->package_fields['label'], []));
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            tyson Tyson Phillips (Inactive)
            Reporter:
            tyson Tyson Phillips (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

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

              Time Tracking

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

                Agile