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 2024-04-03 15:24:10

julrom
Member
Registered: 2005-01-05
Posts: 49

PHP Warning (2): Undefined array key "genericobject"

Bonjour,

Depuis la migration du plugin GenericObject en version 2.14.9, mes objets personnels ne fonctionnent plus et j'ai ces messages d'erreur :

PHP Warning (2): Undefined array key "genericobject" in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 5
PHP Warning (2): Trying to access array offset on value of type null in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 5
PHP Warning (2): Trying to access array offset on value of type null in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 5

PHP Warning (2): Undefined array key "genericobject" in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 9
PHP Warning (2): Trying to access array offset on value of type null in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 9
PHP Warning (2): Trying to access array offset on value of type null in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 9

PHP Warning (2): Undefined array key "genericobject" in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 14
PHP Warning (2): Trying to access array offset on value of type null in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 14
PHP Warning (2): Trying to access array offset on value of type null in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 14

PHP Warning (2): Undefined array key "genericobject" in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 19
PHP Warning (2): Trying to access array offset on value of type null in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 19
PHP Warning (2): Trying to access array offset on value of type null in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 19

PHP Warning (2): Undefined array key "genericobject" in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 24
PHP Warning (2): Trying to access array offset on value of type null in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 24
PHP Warning (2): Trying to access array offset on value of type null in /var/lib/glpi/_plugins/genericobject/fields/courrierentrant.constant.php at line 24

Mon code ci-dessous :

Fichier courrierentrant.constant.php

<?php
global $GO_FIELDS, $LANG;

// Date
$GO_FIELDS['datereception']['name']       = $LANG['genericobject']['fields'][1];
$GO_FIELDS['datereception']['input_type'] = 'datetime';

// Adresse
$GO_FIELDS['plugin_genericobject_adresses_id']['name']       = $LANG['genericobject']['PluginGenericobjectCourrierentrant'][2];
$GO_FIELDS['plugin_genericobject_adresses_id']['field']      = 'adresse';
$GO_FIELDS['plugin_genericobject_adresses_id']['input_type'] = 'dropdown';

// Expediteur
$GO_FIELDS['plugin_genericobject_expediteurentrants_id']['name']       = $LANG['genericobject']['PluginGenericobjectCourrierentrant'][3];
$GO_FIELDS['plugin_genericobject_expediteurentrants_id']['field']      = 'expediteur_entrant';
$GO_FIELDS['plugin_genericobject_expediteurentrants_id']['input_type'] = 'dropdown';

// Objet
$GO_FIELDS['plugin_genericobject_objets_id']['name']       = $LANG['genericobject']['PluginGenericobjectCourrierentrant'][4];
$GO_FIELDS['plugin_genericobject_objets_id']['field']      = 'objet';
$GO_FIELDS['plugin_genericobject_objets_id']['input_type'] = 'dropdown';

// Destinataire
$GO_FIELDS['plugin_genericobject_destinataireentrants_id']['name']       = $LANG['genericobject']['PluginGenericobjectCourrierentrant'][5];
$GO_FIELDS['plugin_genericobject_destinataireentrants_id']['field']      = 'destinataire_entrant';
$GO_FIELDS['plugin_genericobject_destinataireentrants_id']['input_type'] = 'dropdown';

?>

Fichier courrierentrant.fr_FR.php

<?php
$LANG['genericobject']['PluginGenericobjectCourrierentrant'][0]="Courrier entrant";
$LANG['genericobject']['fields'][1]="Date de réception";
$LANG['genericobject']['PluginGenericobjectCourrierentrant'][2]="Adresse";
$LANG['genericobject']['PluginGenericobjectCourrierentrant'][3]="Expediteur";
$LANG['genericobject']['PluginGenericobjectCourrierentrant'][4]="Objet";
$LANG['genericobject']['PluginGenericobjectCourrierentrant'][5]="Destinataire";

Quelqu'un saurait me dire ce qui se passe ?
Merci.


GLPI 10.0.14 - Serveur Debian 12 - PHP 8.2.17 - Server MariaDB Version: 10.11.6

Offline

#2 2024-04-04 16:56:16

Oloron
Member
Registered: 2023-08-02
Posts: 17

Re: PHP Warning (2): Undefined array key "genericobject"

Bonjour,

Je vient de voir que j'ai le même soucis que toi dans la même configuration et que j'ai également ouvert un ticket. As tu résolut le soucis ?

Offline

#3 2024-04-04 18:15:52

julrom
Member
Registered: 2005-01-05
Posts: 49

Re: PHP Warning (2): Undefined array key "genericobject"

Non malheureusement.

J'attends toujours de l'aide de la communauté.


GLPI 10.0.14 - Serveur Debian 12 - PHP 8.2.17 - Server MariaDB Version: 10.11.6

Offline

#4 2024-04-05 11:37:24

Oloron
Member
Registered: 2023-08-02
Posts: 17

Re: PHP Warning (2): Undefined array key "genericobject"

J'ai trouvé une solution, je suis repassé en 2.14.8.

  • désactivation de la 2.14.9[ dans la configuration de glpi/*]

  • suppression ou deplacement du dossier du plugin 2.14.9 (/marketplace) dans un dossier backup par exemple

  • puis copier le dossier du plugin de la version 2.14.8.

  • reactivation du plugin dans la configuration de glpi.

Last edited by Oloron (2024-04-05 11:38:33)

Offline

#5 2024-04-08 09:03:42

julrom
Member
Registered: 2005-01-05
Posts: 49

Re: PHP Warning (2): Undefined array key "genericobject"

Merci Oloron pour ta réponse.
C'est effectivement ce que j'ai fait.

Cordialement.


GLPI 10.0.14 - Serveur Debian 12 - PHP 8.2.17 - Server MariaDB Version: 10.11.6

Offline

#6 2024-05-27 23:54:40

wolvverinemp
Member
From: Poland
Registered: 2021-09-20
Posts: 31

Re: PHP Warning (2): Undefined array key "genericobject"

Même problème - bug dans la nouvelle version IMHO :

forum.glpi-project.org/viewtopic.php?pid=510709#p510709

Offline

Board footer

Powered by FluxBB