You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2012-05-15 15:24:32

tomolimo
Member
From: Grenoble, France
Registered: 2009-05-12
Posts: 515

installation plugin bug with planning_populate hook

dear all,
I found a bug in function

plugin_planning_populate_installations

in file hook.php of the installation plugin.
this function returns an empty array when there is no nothing to rrturn: it means the next plugin in the calling hook will get an empty parameter. this implies that it will also returns an empty array, even if otherwise there would be something to return.
Version of the installation plugin: 1.7.0
here is the code:

function plugin_planning_populate_installations($options = array()) {
    global $DB,$CFG_GLPI, $LANG;
    
    $first=true;

    $parm = array();
      
   if (!isset($options['begin']) || !isset($options['begin'])
         || !isset($options['begin']) || !isset($options['end'])) {
      return $options;
   }
   
   $who       = $options['who'];
   $who_group = $options['who_group'];
   $begin     = $options['begin'];
   $end       = $options['end'];

here is the fix:

function plugin_planning_populate_installations($options = array()) {
    global $DB,$CFG_GLPI, $LANG;
    
    $first=true;

    $parm = array();
      
   if (!isset($options['begin']) || !isset($options['begin'])
         || !isset($options['begin']) || !isset($options['end'])) {
      return $options;
   }

   $parm = $options ;
   
   $who       = $options['who'];
   $who_group = $options['who_group'];
   $begin     = $options['begin'];
   $end       = $options['end'];

regards,
Tomolimo


GLPI 9.2.4 - PHP 7.2.13 x64 / ProcessMaker 3.3.0-community-RE-1.7 - PHP 7.1.24 x64 / Windows 2012 x64 / IIS 8.5 / MySQL 5.7.17 x64
Worldwide: >12316 PC, >9400 users (16 languages, >11 timezones), >360k tickets, >3600 entities, >4200 groups
Raynet is ARaymond (http://www.araymond.com) IT service management

Offline

Board footer

Powered by FluxBB