yllen / behaviors

This plugin allows you to add optional behaviors to GLPI.
GNU Affero General Public License v3.0
14 stars 15 forks source link

Request for Clarification on PHP Warnings Impacting GLPI Functionality #109

Open glionel opened 2 months ago

glionel commented 2 months ago

Bonjour.

I notice several warnings in my logs, but I'm not sure what they correspond to or what impact they currently have on my GLPI. However, I don't see any bugs during usage. Could you enlighten me on the meaning of these warnings?

[2024-04-16 10:24:58] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "users_id" in C:\inetpub\wwwroot\glpi10\plugins\behaviors\inc\itilfollowup.class.php at line 50 Backtrace : src\Plugin.php:1680 PluginBehaviorsITILFollowup::beforeAdd() src\CommonDBTM.php:1294 Plugin::doHook() front\itilfollowup.form.php:58 CommonDBTM->add() public\index.php:82 require()

[2024-04-16 10:28:04] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "users_id" in C:\inetpub\wwwroot\glpi10\plugins\behaviors\inc\itilfollowup.class.php at line 50 Backtrace : src\Plugin.php:1680 PluginBehaviorsITILFollowup::beforeAdd() src\CommonDBTM.php:1294 Plugin::doHook() front\itilfollowup.form.php:58 CommonDBTM->add() public\index.php:82 require()

[2024-04-16 10:35:25] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "users_id" in C:\inetpub\wwwroot\glpi10\plugins\behaviors\inc\itilfollowup.class.php at line 50 Backtrace : src\Plugin.php:1680 PluginBehaviorsITILFollowup::beforeAdd() src\CommonDBTM.php:1294 Plugin::doHook() front\itilfollowup.form.php:58 CommonDBTM->add() public\index.php:82 require()


GLPI 10.0.11 ( => C:\inetpub\wwwroot\glpi10) Installation mode: TARBALL Current language:fr_FR

Operating system: Windows NT SVMPGLPI01 10.0 build 20348 (Windows Server 2022) AMD64 PHP 8.2.10 cgi-fcgi (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, bz2, calendar, cgi-fcgi, com_dotnet, ctype, curl, date, dba, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, random, readline, session, soap, sodium, standard, tidy, tokenizer, xml, xmlreader, xmlwriter, zend_test, zip, zlib) Setup: max_execution_time="60" memory_limit="1024M" post_max_size="8M" safe_mode="" session.save_handler="files" upload_max_filesize="2M" disable_functions="" Software: Microsoft-IIS/10.0 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0 Server Software: MySQL Community Server - GPL Server Version: 8.1.0 Server SQL Mode: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION Parameters: root@localhost/glpidb Host info: localhost via TCP/IP

PHP version (8.2.10) is supported.PHP version (8.2.10) is supported. Sessions configuration is OK.Sessions configuration is OK. Allocated memory is sufficient.Allocated memory is sufficient. mysqli extension is installed.mysqli extension is installed. Following extensions are installed: dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter.Following extensions are installed: dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter. curl extension is installed.curl extension is installed. gd extension is installed.gd extension is installed. intl extension is installed.intl extension is installed. zlib extension is installed.zlib extension is installed. The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present. Database engine version (8.1.0) is supported.Database engine version (8.1.0) is supported. No files from previous GLPI version detected.No files from previous GLPI version detected. The log file has been created successfully.The log file has been created successfully. Write access to C:\inetpub\wwwroot\glpi10/files/_cache has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_cron has been validated. Write access to C:\inetpub\wwwroot\glpi10/files has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_dumps has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_graphs has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_lock has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_pictures has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_plugins has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_rss has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_sessions has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_tmp has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_uploads has been validated.Write access to C:\inetpub\wwwroot\glpi10/files/_cache has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_cron has been validated. Write access to C:\inetpub\wwwroot\glpi10/files has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_dumps has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_graphs has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_lock has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_pictures has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_plugins has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_rss has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_sessions has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_tmp has been validated. Write access to C:\inetpub\wwwroot\glpi10/files/_uploads has been validated.

Web server root directory configuration seems safe.Web server root directory configuration seems safe. Sessions configuration is secured.Sessions configuration is secured. OS and PHP are relying on 64 bits integers.OS and PHP are relying on 64 bits integers. exif extension is installed.exif extension is installed. ldap extension is installed.ldap extension is installed. openssl extension is installed.openssl extension is installed. Following extensions are installed: bz2, Phar, zip.Following extensions are installed: bz2, Phar, zip. Zend OPcache extension is installed.Zend OPcache extension is installed. Following extensions are installed: ctype, iconv, mbstring, sodium.Following extensions are installed: ctype, iconv, mbstring, sodium. Write access to C:\inetpub\wwwroot\glpi10/marketplace has been validated.Write access to C:\inetpub\wwwroot\glpi10/marketplace has been validated. Timezones seems not loaded, see https://glpi-install.readthedocs.io/en/latest/timezones.html.Timezones seems not loaded, see https://glpi-install.readthedocs.io/en/latest/timezones.html.


behaviors            Name: Comportements                  Version: 2.7.3      State: Enabled                                 
    Install Method: Manual
escalade             Name: Escalades                      Version: 2.9.2      State: Enabled                                 
    Install Method: Manual
formcreator          Name: Form Creator                   Version: 2.13.7     State: Enabled                                 
    Install Method: Manual
oauthimap            Name: Oauth IMAP                     Version: 1.4.3      State: Not installed                           
    Install Method: Manual
satisfaction         Name: Plus de satisfaction           Version: 1.6.2      State: Enabled                                 
    Install Method: Manual
vip                  Name: VIP                            Version: 1.8.2      State: Enabled                                 
    Install Method: Manual
yllen commented 2 months ago

Try this correction to fix your issue: https://github.com/yllen/behaviors/commit/5d21ecf13a08b82855e208d5dc36ae2a944e888c

jbtele29 commented 1 month ago

Hello, When i add your fix i have this error now

[2024-06-05 11:28:36] glpiphplog.WARNING:   *** PHP User Warning (512): getFromDBByCrit expects to get one result, 2 found in query "SELECT `id` FROM `glpi_tickets_users` WHERE `tickets_id` = '93525' AND `type` = '2'". in /var/www/html/glpi/src/CommonDBTM.php at line 399
  Backtrace :
  src/CommonDBTM.php:399                             trigger_error()
  ...etplace/behaviors/inc/itilfollowup.class.php:48 CommonDBTM->getFromDBByCrit()
  src/Plugin.php:1680                                PluginBehaviorsITILFollowup::beforeAdd()
  src/CommonDBTM.php:1294                            Plugin::doHook()
  front/itilfollowup.form.php:58                     CommonDBTM->add()
  public/index.php:82                                require()

when I manually delete the person from the follow-up and then the person resubmits a follow-up, it doesn't add the person to the follow-up

Thanks