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 2018-12-07 16:34:15

desousalopes
Member
Registered: 2018-12-07
Posts: 1

Webservice 1.9.0 and Sessions

Hello.

I use the Webservice 1.9.0 plugin, when i excecute de request glpi.addTicketDocument, give me an error
on the  function addMessageAfterRedirect($msg, $check_once = false, $message_type = INFO,                                           $reset = false), on the line array_push($array[$message_type], $msg);

if i change the line to  "$array[$message_type] = $msg;" i haven't problems, but this is not the best way beacuase i change the core of GLPI.

Can you guys have any ideia how to change this?

Above the class in inc/session.class.php.

static function addMessageAfterRedirect($msg, $check_once = false, $message_type = INFO,
                                           $reset = false) {

      if (!empty($msg)) {
         if (self::isCron()) {
            // We are in cron mode
            // Do not display message in user interface, but record error
            if ($message_type == ERROR) {
               Toolbox::logInFile('cron', $msg."\n");
            }

         } else {
            $array = &$_SESSION['MESSAGE_AFTER_REDIRECT'];

            if ($reset) {
               $array = [];
            }

            if (!isset($array[$message_type])) {
               $array[$message_type] = [];
            }

            if (!$check_once
                || !isset($array[$message_type])
                || in_array($msg, $array[$message_type]) === false) {
               //array_push($array[$message_type], $msg);
               $array[$message_type] = $msg;
            }
         }
      }
   }

Thanks for the good work.

Offline

Board footer

Powered by FluxBB