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

[9.4] Some dropdown options broken #5059

Closed
cconard96 opened this issue Dec 9, 2018 · 3 comments
Closed

[9.4] Some dropdown options broken #5059

cconard96 opened this issue Dec 9, 2018 · 3 comments

Comments

@cconard96
Copy link
Contributor

cconard96 commented Dec 9, 2018

Describe the bug

When using certain dropdowns in search, you get the following error in place of the dropdown:

Fatal error: Uncaught TypeError: Argument 1 passed to Dropdown::addNewCondition() must be of the type array, string given, called in /var/www/html/94/inc/dropdown.class.php on line 162 and defined in /var/www/html/94/inc/dropdown.class.php:283 Stack trace: #0 /var/www/html/94/inc/dropdown.class.php(162): Dropdown::addNewCondition('is_requester') #1 /var/www/html/94/inc/commondbtm.class.php(3836): Dropdown::show('Group', Array) #2 /var/www/html/94/inc/commondbtm.class.php(4748): CommonDBTM::dropdown(Array) #3 /var/www/html/94/inc/ticket.class.php(6792): CommonDBTM->getValueToSelect(Array, 'criteria[1][val...', Array, Array) #4 /var/www/html/94/inc/search.class.php(2915): Ticket->getValueToSelect(Array, 'criteria[1][val...', '', Array) #5 /var/www/html/94/ajax/search.php(62): Search::displaySearchoptionValue(Array) #6 {main} thrown in /var/www/html/94/inc/dropdown.class.php on line 283

Page(s) URL

/front/ticket.php and other search pages

To reproduce

Steps to reproduce the behavior:

  1. Open a search form (Testing with Ticket and Computer)
  2. Add a Requester Group or Computer status rule and change criteria type to "Is", "Under","In Not", or "Not Under".
    Note: Other dropdowns seem functional such as Requester and Entity.

Expected behavior

The dropdown is generated and shown.

Logs

[2018-12-09 10:40:17] glpiphplog.NOTICE: Dropdown::show() in /var/www/html/94/inc/dropdown.class.php line 84
Using a string in condition option is deprecated.  {"user":"2@CCDev-PC"} 

Your GLPI setup (you can find it in Setup > General menu, System tab)

GLPI 9.4.0-dev-git-master-e2dbd62 (/94 => /var/www/html/94) Installation mode: GIT

Operating system: Linux CCDev-PC 4.18.12-041812-generic #201810032137 SMP Thu Oct 4 01:39:48 UTC 2018 x86_64
PHP 7.0.32-0ubuntu0.16.04.1 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, apcu, 	calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, json, ldap, libxml, mbstring, 	mysqli, mysqlnd, openssl, pcre, pdo_mysql, posix, readline, session, shmop, snmp, sockets, standard, sysvmsg, sysvsem, sysvshm, 	tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zlib)
Setup: max_execution_time="30" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files" 	upload_max_filesize="2M" 
Software: Apache/2.4.18 (Ubuntu) (Apache/2.4.18 (Ubuntu) Server at localhost Port 80) 	Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 
Server Software: Ubuntu 16.04 	Server Version: 10.0.36-MariaDB-0ubuntu0.16.04.1 	Server SQL Mode:  	Parameters: root@localhost/94 	Host info: Localhost via UNIX socket

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
APCu extension is installed
xmlrpc extension is not present
CAS extension is not present
Database version seems correct (10.0.36) - Perfect!
/var/www/html/94/files/_log : OK
/var/www/html/94/config : OK
/var/www/html/94/files : OK
/var/www/html/94/files/_dumps : OK
/var/www/html/94/files/_sessions : OK
/var/www/html/94/files/_cron : OK
/var/www/html/94/files/_graphs : OK
/var/www/html/94/files/_lock : OK
/var/www/html/94/files/_plugins : OK
/var/www/html/94/files/_tmp : OK
/var/www/html/94/files/_cache : OK
/var/www/html/94/files/_rss : OK
/var/www/html/94/files/_uploads : OK
/var/www/html/94/files/_pictures : OK
Web access to files directory is protected : OK
SELinux mode is Disabled

htmLawed version 1.2.4 in (/var/www/html/94/lib/htmlawed)
phpmailer/phpmailer version 6.0.6 in (/var/www/html/94/vendor/phpmailer/phpmailer/src) 
simplepie/simplepie version 1.5.2 in (/var/www/html/94/vendor/simplepie/simplepie/library) 
tecnickcom/tcpdf version 6.2.26 in (/var/www/html/94/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/var/www/html/94/vendor/michelf/php-markdown/Michelf)
true/punycode in (/var/www/html/94/vendor/true/punycode/src)
iamcal/lib_autolink in (/var/www/html/94/vendor/iamcal/lib_autolink)
sabre/vobject in (/var/www/html/94/vendor/sabre/vobject/lib)
zendframework/zend-cache in (/var/www/html/94/vendor/zendframework/zend-cache/src) 
zendframework/zend-console in (/var/www/html/94/vendor/zendframework/zend-console/src) 
zendframework/zend-i18n in (/var/www/html/94/vendor/zendframework/zend-i18n/src) 
zendframework/zend-serializer in (/var/www/html/94/vendor/zendframework/zend-serializer/src) 
monolog/monolog in (/var/www/html/94/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/var/www/html/94/vendor/sebastian/diff/src)
elvanto/litemoji in (/var/www/html/94/vendor/elvanto/litemoji/src)
symfony/console in (/var/www/html/94/vendor/symfony/console)
leafo/scssphp in (/var/www/html/94/vendor/leafo/scssphp/src)
@cconard96 cconard96 changed the title [9.4] Some dropdown options broken in search [9.4] Some dropdown options broken Dec 9, 2018
cconard96 added a commit to cconard96/glpi that referenced this issue Dec 9, 2018
@ladenree76000
Copy link
Contributor

after upgrade from 9.2.4 to 9.4 beta I also had error message for computer ( i had a personnal view on 9.2.4)
it works with other assets, for tickets, projects...

Fatal error: Uncaught TypeError: Argument 1 passed to Dropdown::addNewCondition() must be of the type array, string given, called in /var/www/html/glpi94/inc/dropdown.class.php on line 161 and defined in /var/www/html/glpi94/inc/dropdown.class.php:282 Stack trace: #0 /var/www/html/glpi94/inc/dropdown.class.php(161): Dropdown::addNewCondition('`is_visible_com...') #1 /var/www/html/glpi94/inc/commondbtm.class.php(3836): Dropdown::show('State', Array) #2 /var/www/html/glpi94/inc/commondbtm.class.php(4748): CommonDBTM::dropdown(Array) #3 /var/www/html/glpi94/inc/search.class.php(2915): CommonDBTM->getValueToSelect(Array, 'criteria[1][val...', Array, Array) #4 /var/www/html/glpi94/inc/search.class.php(2809): Search::displaySearchoptionValue(Array) #5 /var/www/html/glpi94/inc/search.class.php(2494): Search::displaySearchoption(Array) #6 /var/www/html/glpi94/inc/search.class.php(2197): Search::displayCriteria(Array) #7 /var/www/html/glpi94/inc/search.class.php(76): Search::showGenericSearch('Computer', Array) #8 /var/www/html/gl in /var/www/html/glpi94/inc/dropdown.class.php on line 282

@cconard96
Copy link
Contributor Author

Please test the proposed fix from #5064. It should fix that issue in a lot of different locations. Issue seemed to be with the search options on the items and not the forms.

@ladenree76000
Copy link
Contributor

tested with computer.class it seems to work.

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

No branches or pull requests

2 participants