InfotelGLPI/mydashboard

Upgrading from 1.7.6 to 1.7.7 - autoload.php list function

Closed this issue · 3 comments

Hi, i'm having issues upgrading from 1.7.6 to 1.7.7

  • The version of the plugin => 1.7.7
  • The version of your GLPI => 9.4.4
  • The steps to reproduce your issue => upgrade from 1.7.6 to 1.7.7

Output GLPI debug error :

Capture

function name is not accepted.

public function list() {

      $reportsFiles = scandir(GLPI_ROOT . '/plugins/mydashboard/reports');
      $widgets = [];
      foreach ($reportsFiles as $report) {
         if ($report != "." && $report != "..") {
            $reportName = substr($report, 0, strpos($report, "."));
            $className  = "PluginMydashboard" . ucfirst($reportName);
            if ((strpos($className, "PluginMydashboardReports") !== false)
                || (strpos($className, "PluginMydashboardAlert") !== false)) {
               array_push($widgets, $className);
            }
         }
      }

      return $widgets;
   }

glpi 9.4.5, the same problem. Upgrade from 1.7.1

Parse error: syntax error, unexpected 'list' (T_LIST), expecting identifier (T_STRING) in /var/www/plugins/mydashboard/inc/autoload.php on line 41

Do not show any plugins .

Hello,
Sure using list as a function name is a crazy thing...
Try to rename list into liste (ligne 41 of /var/www/plugins/mydashboard/inc/autoload.php) and change it on the only call to this function I have found (ligne 72 of mydashboard/inc/widgetlist.class.php) seems to solve this issue...