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

#2 2019-01-04 11:52:31

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

Re: Webservice 1.9.0 and Sessions

Can you give me the complete error?


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

Board footer

Powered by FluxBB