Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0.18] Undefined array key "name" in contrats #19041

Open
2 tasks done
falco2001 opened this issue Feb 21, 2025 · 7 comments
Open
2 tasks done

[10.0.18] Undefined array key "name" in contrats #19041

falco2001 opened this issue Feb 21, 2025 · 7 comments

Comments

@falco2001
Copy link

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

10.0.18

Bug description

PHP Warning (2): Undefined array key "name" in /var/www/assistance-dev2/src/Search.php at line 7900

Relevant log output

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

@falco2001 falco2001 changed the title Undefined array key "name" in contrats [10.0.18] Undefined array key "name" in contrats Feb 21, 2025
@trasher
Copy link
Contributor

trasher commented Feb 21, 2025

Please provide more information on how to reproduce.

@falco2001
Copy link
Author

falco2001 commented Feb 21, 2025

Here but I do not understand in the logs I have access to contact instead of contracts

[Fri Feb 21 15:01:22.034214 2025] [php:notice] [pid 1820489:tid 1820489] [client 140.xx.250.219:57060] PHP Warning:  Undefined array key "name" in /var/www/assistance-dev2/src/Search.php on line 7900, referer: https://assistance-dev.toto-lyon.fr/front/contact.php
[Fri Feb 21 15:01:22.034235 2025] [php:notice] [pid 1820489:tid 1820489] [client 140.xx.250.219:57060] PHP Stack trace:, referer: https://assistance-dev.toto-lyon.fr/front/contact.php
[Fri Feb 21 15:01:22.034239 2025] [php:notice] [pid 1820489:tid 1820489] [client 140.xx.250.219:57060] PHP   1. {main}() /var/www/assistance-dev2/public/index.php:0, referer: https://assistance-dev.toto-lyon.fr/front/contact.php
[Fri Feb 21 15:01:22.034242 2025] [php:notice] [pid 1820489:tid 1820489] [client 140.xx.250.219:57060] PHP   2. require() /var/www/assistance-dev2/public/index.php:82, referer: https://assistance-dev.toto-lyon.fr/front/contact.php
[Fri Feb 21 15:01:22.034247 2025] [php:notice] [pid 1820489:tid 1820489] [client 140.xx.250.219:57060] PHP   3. Search::show($itemtype = 'Contract') /var/www/assistance-dev2/front/contract.php:42, referer: https://assistance-dev.toto-lyon.fr/front/contact.php
[Fri Feb 21 15:01:22.034254 2025] [php:notice] [pid 1820489:tid 1820489] [client 140.xx.250.219:57060] PHP   4. Search::showList($itemtype = 'Contract', $params = ['start' => 0, 'order' => [0 => 'ASC'], 'sort' => [0 => 1], 'is_deleted' => '0', 'as_map' => '0', 'browse' => '0', 'criteria' => [0 => [...]], 'metacriteria' => [], 'display_type' => 0], $forcedisplay = *uninitialized*) /var/www/assistance-dev2/src/Search.php:179, referer: https://assistance-dev.toto-lyon.fr/front/contact.php
[Fri Feb 21 15:01:22.034258 2025] [php:notice] [pid 1820489:tid 1820489] [client 140.xx.250.219:57060] PHP   5. Search::getDatas($itemtype = 'Contract', $params = ['start' => 0, 'order' => [0 => 'ASC'], 'sort' => [0 => 1], 'is_deleted' => '0', 'as_map' => '0', 'browse' => '0', 'criteria' => [0 => [...]], 'metacriteria' => [], 'display_type' => 0], $forcedisplay = []) /var/www/assistance-dev2/src/Search.php:202, referer: https://assistance-dev.toto-lyon.fr/front/contact.php
[Fri Feb 21 15:01:22.034286 2025] [php:notice] [pid 1820489:tid 1820489] [client 140.xx.250.219:57060] PHP   6. Search::constructData($data = ['search' => ['criteria' => [...], 'metacriteria' => [...], 'sort' => [...], 'order' => [...], 'start' => 0, 'is_deleted' => 0, 'export_all' => 0, 'target' => '/front/contract.php', 'display_type' => 0, 'showmassiveactions' => TRUE, 'dont_flush' => FALSE, 'show_pager' => TRUE, 'show_footer' => TRUE, 'no_sort' => FALSE, 'list_limit' => '50', 'massiveactionparams' => [...], 'as_map' => '0', 'browse' => '0', 'all_search' => FALSE, 'view_search' => TRUE, 'no_search' => TRUE], 'itemtype' => 'Contract', 'item' => class Contract { protected $type = -1; protected $displaylist = TRUE; public $showdebug = FALSE; public $taborientation = 'vertical'; public $get_item_to_display_tab = TRUE; public $fields = [...]; public $input = [...]; public $updates = [...]; public $oldvalues = [...]; public $dohistory = TRUE; public $history_blacklist = [...]; public $auto_message_on_action = TRUE; public $no_form_page = FALSE; public $additional_fields_for_dictionnary = [...]; protected $fkfield = ''; protected $searchopt = FALSE; protected $usenotepad = TRUE; public $deduplicate_queued_notifications = TRUE; public $right = NULL; protected $last_clone_index = NULL }, 'display_type' => 0, 'toview' => [0 => 1, 1 => 80, 2 => 20, 3 => 29, 4 => 31, 5 => 8, 6 => 12, 7 => 4, 8 => 76679], 'meta_toview' => [], 'tocompute' => [0 => 1, 1 => 80, 2 => 20, 3 => 29, 4 => 31, 5 => 8, 6 => 12, 7 => 4, 8 => 76679], 'sql' => ['count' => [...], 'search' => 'SELECT DISTINCT `glpi_contracts`.`id` AS id, \\'ydaoulat\\' AS currentuser,\\n                        `glpi_contracts`.`entities_id`, `glpi_contracts`.`is_recursive`,  `glpi_contracts`.`name` AS `ITEM_Contract_1`,\\n                        `glpi_contracts`.`id` AS `ITEM_Contract_1_id`,\\n                        `glpi_entities`.`completename` AS `ITEM_Contract_80`,  ADDDATE(`glpi_contracts`.`begin_date`,\\n                               INTERVAL (`glpi_contracts`.`duration` ) MONTH) AS `ITEM_Contract_20`,\\n              '..., 'raw' => [...]], 'data' => ['execution_time' => '6.9599151611328', 'totalcount' => 162, 'begin' => 0, 'end' => 49, 'cols' => [...], 'warning' => 'For compatibility keep raw data  (ITEM_X, META_X) at the top for the moment. Will be drop in next version', 'rows' => [...], 'items' => [...], 'currentuser' => 'ydaoulat']], $onlycount = *uninitialized*) /var/www/assistance-dev2/src/Search.php:451, referer: https://assistance-dev.toto-lyon.fr/front/contact.php
[Fri Feb 21 15:01:22.034307 2025] [php:notice] [pid 1820489:tid 1820489] [client 140.xx.250.219:57060] PHP   7. Search::giveItem($itemtype = 'Contract', $ID = 12, $data = ['raw' => ['id' => 155, 'currentuser' => 'ydaoulat', 'entities_id' => 7, 'is_recursive' => 0, 'ITEM_Contract_1' => 'Archive Exercice de crise', 'ITEM_Contract_1_id' => 155, 'ITEM_Contract_80' => 'Entit\xc3\xa9 racine > Direction Syst\xc3\xa8mes Information', 'ITEM_Contract_20' => NULL, 'ITEM_Contract_29' => 'ARCHIVE ORNISEC$#$1265', 'ITEM_Contract_31' => 'Echu', 'ITEM_Contract_8' => 'Projet SSI', 'ITEM_Contract_12_begin_date' => NULL, 'ITEM_Contract_12_duration' => 0, 'ITEM_Contract_12_renewal' => 0, 'ITEM_Contract_12_periodicity' => 0, 'ITEM_Contract_4' => 'Contrat', 'ITEM_Contract_76679' => 'SCHMITZ Nicolas$#$10'], 'id' => 155, 'entities_id' => 7, 'is_recursive' => 0, 'Contract_1' => ['count' => 1, 0 => [...], 'displayname' => '<a id=\\'Contract_155_155\\' href=\\'/front/contract.form.php?id=155\\'>Archive Exercice de crise</a>'], 'Contract_80' => ['count' => 1, 0 => [...], 'displayname' => '<span class="glpi-badge" title="Entit\xc3\xa9 racine &gt; Direction Syst\xc3\xa8mes Information"><span class="text-nowrap">Entit\xc3\xa9 racine</span><i class="fas fa-caret-right mx-1"></i><span class="text-nowrap">Direction Syst\xc3\xa8mes Information</span></span>'], 'Contract_20' => ['count' => 1, 0 => [...], 'displayname' => '<span class=\\'text-nowrap\\'></span>'], 'Contract_29' => ['count' => 1, 0 => [...], 'displayname' => '<a id=\\'Supplier_155_1265\\' href=\\'/front/supplier.form.php?id=1265\\'>ARCHIVE ORNISEC</a>'], 'Contract_31' => ['count' => 1, 0 => [...], 'displayname' => 'Echu'], 'Contract_8' => ['count' => 1, 0 => [...], 'displayname' => 'Projet SSI'], 'Contract_12' => ['count' => 1, 0 => [...]], 'Contract_4' => ['count' => 1, 0 => [...]], 'Contract_76679' => ['count' => 1, 0 => [...]]], $meta = *uninitialized*, $addobjectparams = *uninitialized*, $orig_itemtype = *uninitialized*) /var/www/assistance-dev2/src/Search.php:1734, referer: https://assistance-dev.toto-lyon.fr/front/contact.php

@trasher
Copy link
Contributor

trasher commented Feb 21, 2025

That still do not explain how to reproduce.

@trasher
Copy link
Contributor

trasher commented Feb 21, 2025

We need a way to reproduce on a fresh install, without plugins.

@falco2001
Copy link
Author

does the test with all plugins disabled same problem . Thank you

@cconard96
Copy link
Contributor

cconard96 commented Feb 21, 2025

This still isn't enough information unfortunately. Contact and Contracts search both seem to work for me.

What is the URL of the page where you have this issue?
If this is a search results page, which columns are visible?
Are you able to identify a specific item in the results that causes it to break, and if so, what information is set/missing/linked for it?

Best I can tell is you have a column showing that involves multiple items and one of those items has invalid data.

@falco2001
Copy link
Author

falco2001 commented Feb 21, 2025

This still isn't enough information unfortunately. Contact and Contracts search both seem to work for me.

What is the URL of the page where you have this issue? https://assistance-dev.xxx-lyon.fr/front/contract.php
If this is a search results page, which columns are visible? Are you able to identify a specific item in the results that causes it to break, and if so, what information is set/missing/linked for it? **

  Nom Entité Date de fin Fournisseurs associés Statut Lieu Expiration Type Plugins - Champs supplémentaires - Interlocuteur DSI
** > > Best I can tell is you have a column showing that involves multiple items and one of those items has invalid data.

with fielsd plugin disabled it’s the same . Shows in debug mode only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants