pluginsGLPI / ocsinventoryng

Plugin ocsinventoryng for GLPI
GNU General Public License v2.0
68 stars 52 forks source link

Php warning after GLPI upgrade from 9.5.7 to 9.5.11 #339

Closed CireSacud26 closed 1 year ago

CireSacud26 commented 1 year ago

Hello,

PHP Warning (2): Declaration of PluginOcsinventoryngTeamviewer::generateLinkContents($link, CommonDBTM $item) should be compatible with CommonDBTM::generateLinkContents($link, CommonDBTM $item, bool $safe_url = true) in .\plugins\ocsinventoryng\inc\teamviewer.class.php at line 326

Thanks for helping to remove this.

Regards, Eric

CireSacud26 commented 1 year ago

Forgot to say that it's appears in super-admin profile with debug mode on.

tsmr commented 1 year ago

Replace into inc\teamviewer.class.php by

/**
    * @param string     $link
    * @param CommonDBTM $item
    *
    * @return array
    */
   public static function generateLinkContents($link, CommonDBTM $item, bool $safe_url = true) {

      if (strstr($link, "[TWID]")) {
         $link = str_replace("[TWID]", $item->fields['twid'], $link);
         return [$link];
      }

      return parent::generateLinkContents($link, $item);
   }
CireSacud26 commented 1 year ago

Hi tsmr !

Quick and nice fix. It works now like a charm !

Thanks !