glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.3k stars 1.29k forks source link

[GLPI 9.4.3] Empty lines in ticket search when in selfservice #6308

Closed tomolimo closed 2 years ago

tomolimo commented 5 years ago

Hello,

Here is a screencopy of the bug:

image

Here are the steps to reproduce this:

  1. in an empty GLPI DB (= a newly installed DB). This bug also occurs in none-empty DB.
  2. Log in GLPI with "glpi" user
  3. create a group: Group A
  4. add to this group the "post-only" user
  5. create a ticket with "glpi" user for requester and assigned to
  6. add "tech" user and "normal" user as watcher
  7. add "group A" group as watcher
  8. log off, and log in as "post-only' user
  9. go to ticket list
  10. empty the search criterion and click on "search"

When in debug, here are the errors that are shown: image

And in the php-errors.log:

[2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659 PHP Warning(2): Invalid argument supplied for foreach() Backtrace : inc\search.class.php:1368
inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX "} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659
PHP Notice(8): Undefined index: Ticket_2 Backtrace : inc\search.class.php:6088
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659 PHP Notice(8): Undefined index: Ticket_1 Backtrace : inc\search.class.php:5833
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659
PHP Notice(8): Undefined index: Ticket_80 Backtrace : inc\search.class.php:6183
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659 PHP Notice(8): Undefined index: Ticket_12 Backtrace : inc\search.class.php:5740
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659
PHP Notice(8): Undefined index: Ticket_12 Backtrace : inc\search.class.php:5741
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659 PHP Notice(8): Undefined index: Ticket_19 Backtrace : inc\search.class.php:6027
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659
PHP Notice(8): Undefined index: Ticket_15 Backtrace : inc\search.class.php:6027
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659 PHP Notice(8): Undefined index: Ticket_3 Backtrace : inc\search.class.php:6183
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659
PHP Notice(8): Undefined index: Ticket_4 Backtrace : inc\search.class.php:5299
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659 PHP Notice(8): Undefined index: Ticket_5 Backtrace : inc\search.class.php:5299
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659
PHP Notice(8): Undefined index: Ticket_7 Backtrace : inc\search.class.php:6183
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659 PHP Notice(8): Undefined index: Ticket_18 Backtrace : inc\search.class.php:6027
inc\search.class.php:1442 Search::giveItem() inc\search.class.php:98 Search::constructData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.59Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659
PHP Notice(8): Undefined index: id Backtrace : inc\search.class.php:1759
inc\search.class.php:99 Search::displayData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.003\", 2.63Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659 PHP Notice(8): Undefined offset: 0 Backtrace : inc\search.class.php:5191
inc\search.class.php:1793 Search::displayConfigItem() inc\search.class.php:99 Search::displayData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.64Mio)"} [2019-09-16 09:27:29] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in \inc\toolbox.class.php line 659
PHP Notice(8): Undefined index: glpipriority_ Backtrace : inc\search.class.php:5191
inc\search.class.php:1793 Search::displayConfigItem() inc\search.class.php:99 Search::displayData() inc\search.class.php:80 Search::showList() front\ticket.php:45 Search::show() {"user":"3@XXXXXX ","mem_usage":"0.000\", 2.64Mio)"}

This bug is also present in GLPI 9.2 and 9.3...

And here is the GLPI configuration

[code]

GLPI 9.4.3 ( => )
Installation mode: TARBALL

Server

Operating system: Windows NT XXXXXX 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
PHP 7.3.7 cgi-fcgi (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, calendar, cgi-fcgi, ctype, curl, date,
    dom, exif, fileinfo, filter, gd, hash, iconv, imap, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, openssl, pcre,
    readline, session, soap, standard, tokenizer, v8js, wddx, wincache, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="300" memory_limit="1G" post_max_size="80M" safe_mode="" session.save_handler="files"
    upload_max_filesize="10M" 
Software: Microsoft-IIS/8.5
    Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
Server Software: MySQL Community Server (GPL)
    Server Version: 5.7.17-log
    Server SQL Mode: 
    Parameters: glpi@127.0.0.1/glpi9.4official
    Host info: 127.0.0.1 via TCP/IP

mysqli extension is installed
ctype extension is installed
fileinfo extension is installed
json extension is installed
mbstring extension is installed
iconv extension is installed
zlib extension is installed
curl extension is installed
gd extension is installed
simplexml extension is installed
xml extension is installed
ldap extension is installed
imap extension is installed
Zend OPcache extension is installed
xmlrpc extension is installed
exif extension is installed
APCu extension is not present
CAS extension is not present
Database version seems correct (5.7.17) - Perfect!Database version seems correct (5.7.17) - Perfect!
/files/_log : OK
/config : OK
/files : OK
/files/_dumps : OK
/files/_sessions : OK
/files/_cron : OK
/files/_graphs : OK
/files/_lock : OK
/files/_plugins : OK
/files/_tmp : OK
/files/_cache : OK
/files/_rss : OK
/files/_uploads : OK
/files/_pictures : OK
Web access to the files directory should not be allowed but this cannot be checked automatically on this instance.
Make sure acces to error log file is forbidden; otherwise review .htaccess file and web server configuration.
Libraries

htmLawed version 1.2.4 in (\lib\htmlawed)
phpmailer/phpmailer version 6.0.7 in (\vendor\phpmailer\phpmailer\src)
simplepie/simplepie version 1.5.2 in (\vendor\simplepie\simplepie\library)
tecnickcom/tcpdf version 6.2.26 in (\vendor\tecnickcom\tcpdf)
michelf/php-markdown in (\vendor\michelf\php-markdown\Michelf)
true/punycode in (\vendor\true\punycode\src)
iamcal/lib_autolink in (\vendor\iamcal\lib_autolink)
sabre/vobject in (\vendor\sabre\vobject\lib)
zendframework/zend-cache in (\vendor\zendframework\zend-cache\src)
zendframework/zend-i18n in (\vendor\zendframework\zend-i18n\src)
zendframework/zend-serializer in (\vendor\zendframework\zend-serializer\src)
monolog/monolog in (\vendor\monolog\monolog\src\Monolog)
sebastian/diff in (\vendor\sebastian\diff\src)
elvanto/litemoji in (\vendor\elvanto\litemoji\src)
symfony/console in (\vendor\symfony\console)
leafo/scssphp in (\vendor\leafo\scssphp\src)

SQL replicas

Not active

Notifications

Way of sending emails: PHP

Mails receivers

Plugins list

[/code]

Thank you Regards, Tomolimo

chauchse commented 5 years ago

Dear,

I have the same bug. I did not have this bug in 9.4.3. This bug appears with 9.4.4

Do you have a fix ?

Thanks

chauchse commented 5 years ago

I tried to create a new self-service profile, i have the same issue

github-actions[bot] commented 3 years ago

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

tomolimo commented 3 years ago

Hello, This has not been fixed, it is still present in GLPI 9.5.x Thank you Regards, Tomolimo

github-actions[bot] commented 2 years ago

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

tomolimo commented 2 years ago

Any up?

cconard96 commented 2 years ago

I tried following your steps to recreate on the latest 9.5 commit but couldn't recreate the issue. Can you provide an updated error and stack trace?

cconard96 commented 2 years ago

Tested on GLPI 10 as well without being able to recreate the issue. If it can be reproduced on the latest 9.5 release at least, we will need an updated error and stack trace to troubleshoot as the last one provided was for 9.4.3. The query used for the search which can be found using debug mode could be helpful too.

cconard96 commented 2 years ago

No update for a while, so I'll close this for now. If the issue can be recreated in version 9.5.7 or 10 (or the current nightly "main" release until the stable release of 10), feel free to reopen or open a new issue with an updated stack trace from the error logs.

As far as I can tell looking at the 9.4.3 source, the issue may be occurring when trying to fetch specific records from the DB. Therefore, it would be useful to know if any SQL errors or warnings are logged in the files/_log/sql-errors.log file and what search query shows in the GLPI debug information panel.

To access debug information in versions before GLPI 10:

  1. Enable debug mode in your user preferences (must have update permission for General Setup in profile)
  2. Open debug panel by clicking the bug icon in the bottom right of the page

For version 10:

  1. Enable debug mode in the account information dropdown in the top right
  2. Click the bug icon in the account information area in the top right

If the user doesn't have the update permission for General Setup, you can log in with an account that does and enable debug mode, then use the impersonation feature (added in 9.5) to impersonate the user that experiences this issue.