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
4k stars 1.25k forks source link

10.0.9 : Bad display for drodown list #15201

Open stonebuzz opened 12 months ago

stonebuzz commented 12 months ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.9

Bug description

Found a bug while dev a fix from fields plugin

bug involving the use of ajax/dropdownAllItem.php and the use of the Default size for drop-down lists option when there are more items than the configured limit.

See this example from DatabaseInstance

image

image

https://github.com/pluginsGLPI/fields/pull/667#issuecomment-1630978791

Relevant log output

nothing

Page URL

10.0-bugfixes/front/databaseinstance.form.php?id=1

Steps To reproduce

  1. Create 10 computer
  2. decrease limit option for drodown list (to 2)
  3. Create database instance
  4. Select Computer as itemtype
  5. Try to select items_id

Your GLPI setup information

Informations sur le système, l'installation et la configuration
GLPI 10.0.9-git-project_task_massive_action-45f6be11ec (/GLPI/10.0-bugfixes => /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes)
Installation mode: GIT
Current language:fr_FR

Server
 
Operating system: Linux stanislas-asus-desktop 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64
PHP 8.1.21 apache2handler (Core, FFI, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, bz2, calendar, ctype,
    curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, json, ldap, libxml, mbstring, mysqli,
    mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, posix, pspell, readline, session, shmop, soap, sockets, sodium, sqlite3, ssh2,
    standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="600" memory_limit="1500M" post_max_size="1500M" safe_mode="" session.save_handler="files"
    upload_max_filesize="1500M" 
Software: Apache/2.4.52 (Ubuntu) (Apache/2.4.52 (Ubuntu) Server at 127.0.0.1 Port 80
)
    Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0
Server Software: Ubuntu 22.04
    Server Version: 10.6.12-MariaDB-0ubuntu0.22.04.1
    Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    Parameters: root@localhost/10bugfixes
    Host info: Localhost via UNIX socket

PHP version (8.1.21) is supported.
Sessions configuration is OK.
Allocated memory is sufficient.
mysqli extension is installed.
Following extensions are installed: dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter.
curl extension is installed.
gd extension is installed.
intl extension is installed.
zlib extension is installed.
The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
Database engine version (10.6.12) is supported.
No files from previous GLPI version detected.
The log file has been created successfully.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_cache has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/config has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_cron has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_dumps has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_graphs has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_lock has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_pictures has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_plugins has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_rss has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_sessions has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_tmp has been validated.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_uploads has been validated.

Web server root directory configuration is not safe as it permits access to non-public files. See installation documentation for more details.
The following directories should be placed outside "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes":
‣ "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files" ("GLPI_VAR_DIR")
‣ "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/config" ("GLPI_CONFIG_DIR")
You can ignore this suggestion if your web server root directory is "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/public".
Sessions configuration is secured.
OS and PHP are relying on 64 bits integers.
exif extension is installed.
ldap extension is installed.
openssl extension is installed.
Following extensions are installed: bz2, Phar, zip.
Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to /home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/marketplace has been validated.
Timezones seems loaded in database.

GLPI constants
 
GLPI_ROOT: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes"
GLPI_CONFIG_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/config"
GLPI_VAR_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files"
GLPI_MARKETPLACE_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/marketplace"
GLPI_USE_CSRF_CHECK: "1"
GLPI_CSRF_EXPIRES: "7200"
GLPI_CSRF_MAX_TOKENS: "100"
GLPI_USE_IDOR_CHECK: "1"
GLPI_IDOR_EXPIRES: "7200"
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: false
GLPI_SERVERSIDE_URL_ALLOWLIST: ["/^(https?|feed):\\/\\/[^@:]+(\\/.*)?$/"]
GLPI_TELEMETRY_URI: "https://telemetry.glpi-project.org"
GLPI_INSTALL_MODE: "GIT"
GLPI_NETWORK_MAIL: "glpi@teclib.com"
GLPI_NETWORK_SERVICES: "https://services.glpi-network.com"
GLPI_MARKETPLACE_ALLOW_OVERRIDE: true
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true
GLPI_USER_AGENT_EXTRA_COMMENTS: ""
GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: "1"
GLPI_AJAX_DASHBOARD: "1"
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_DEMO_MODE: "0"
GLPI_CENTRAL_WARNINGS: "1"
GLPI_DOC_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files"
GLPI_CACHE_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_cache"
GLPI_CRON_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_cron"
GLPI_DUMP_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_dumps"
GLPI_GRAPH_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_graphs"
GLPI_LOCAL_I18N_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_locales"
GLPI_LOCK_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_lock"
GLPI_LOG_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_log"
GLPI_PICTURE_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_pictures"
GLPI_PLUGIN_DOC_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_plugins"
GLPI_RSS_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_rss"
GLPI_SESSION_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_sessions"
GLPI_TMP_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_tmp"
GLPI_UPLOAD_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_uploads"
GLPI_INVENTORY_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/files/_inventories"
GLPI_NETWORK_REGISTRATION_API_URL: "https://services.glpi-network.com/api/registration/"
GLPI_MARKETPLACE_PLUGINS_API_URI: "https://services.glpi-network.com/api/marketplace/"
GLPI_I18N_DIR: "/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/locales"
GLPI_VERSION: "10.0.9"
GLPI_SCHEMA_VERSION: "10.0.9@77fc44668eaae89b61d95fe606d20d93d66110cd"
GLPI_MARKETPLACE_PRERELEASES: false
GLPI_MIN_PHP: "7.4.0"
GLPI_MAX_PHP: "8.3.0"
GLPI_YEAR: "2023"

Libraries
 
htmlawed/htmlawed version 1.2.14 in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.8.0 in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.8 in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.6.2 in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/michelf/php-markdown/Michelf)
true/punycode in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/true/punycode/src)
iamcal/lib_autolink in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/iamcal/lib_autolink)
sabre/dav in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/sabre/dav/lib/DAV)
sabre/http in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/sabre/http/lib)
sabre/uri in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/sabre/uri/lib)
sabre/vobject in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/sabre/vobject/lib)
laminas/laminas-i18n in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/laminas/laminas-i18n/src)
laminas/laminas-servicemanager in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/laminas/laminas-servicemanager/src)
monolog/monolog in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/sebastian/diff/src)
donatj/phpuseragentparser in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/donatj/phpuseragentparser/src/UserAgent)
elvanto/litemoji in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/elvanto/litemoji/src)
symfony/console in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/symfony/console)
scssphp/scssphp in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/rlanvin/php-rrule/src)
blueimp/jquery-file-upload in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/blueimp/jquery-file-upload/server/php)
ramsey/uuid in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/ramsey/uuid/src)
psr/log in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/psr/log/Psr/Log)
psr/simple-cache in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/psr/simple-cache/src)
psr/cache in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/psr/cache/src)
league/csv in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/league/csv/src)
mexitek/phpcolors in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/guzzlehttp/psr7/src)
glpi-project/inventory_format in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/glpi-project/inventory_format/lib/php)
wapmorgan/unified-archive in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/paragonie/sodium_compat/src)
symfony/cache in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/symfony/cache)
html2text/html2text in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/html2text/html2text/src)
symfony/css-selector in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/symfony/css-selector)
symfony/dom-crawler in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/symfony/dom-crawler)
twig/twig in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/twig/twig/src)
twig/string-extra in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/twig/string-extra)
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php80 not found
symfony/polyfill-php81 not found
symfony/polyfill-php82 in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/symfony/polyfill-php82)
league/oauth2-client in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/league/oauth2-client/src/Provider)
league/oauth2-google in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/league/oauth2-google/src/Provider)
thenetworg/oauth2-azure in (/home/stanislas/TECLIB/DEV/GLPI/10.0-bugfixes/vendor/thenetworg/oauth2-azure/src/Provider)

SQL replicas
 
Not active

Notifications
 
Way of sending emails: PHP

Plugins list
 
    accounts             Name: Accounts                       Version: 3.0.3      State: Not installed                           
        Install Method: Manual
    fields               Name: Additional fields              Version: 1.20.6     State: Enabled                                 
        Install Method: Manual
    advanceddashboard    Name: advanceddashboard              Version: 1.4.2      State: Not installed                           
        Install Method: Marketplace
    approvalbymail       Name: Approval by mail               Version: 2.1.1      State: Not installed                           
        Install Method: Manual
    branding             Name: Branding                       Version: 1.3.2      State: Not installed                           
        Install Method: Manual
    certificatecollector Name: Certificate Collector          Version: 0.0.1      State: Not installed                           
        Install Method: Manual
    cloudinventory       Name: CloudInventory                 Version: 0.0.1      State: Not installed                           
        Install Method: Manual
    collaborativetools   Name: Collaborative tools            Version: 1.2.2      State: Not installed                           
        Install Method: Manual
    behaviors            Name: Comportements                  Version: 2.7.2      State: Installed / not activated               
        Install Method: Manual
    datainjection        Name: Data injection                 Version: 2.13.0     State: Installed / not activated               
        Install Method: Manual
    databaseinventory    Name: Database Inventory             Version: 0.0.5      State: Not installed                           
        Install Method: Manual
    deploy               Name: Deploy                         Version: 0.0.5      State: Not installed                           
        Install Method: Manual
    escalade             Name: Escalation                     Version: 2.9.0      State: Installed / not activated               
        Install Method: Manual
    formcreator          Name: Form Creator                   Version: 2.13.7     State: To update                               
        Install Method: Manual
    fusioninventory      Name: FusionInventory                Version: 10.0.6+1.1 State: Replaced                                
        Install Method: Manual
    agentconfig          Name: GLPI Agent config              Version: 1.2.0      State: Not installed                           
        Install Method: Manual
    carbon               Name: GLPI Carbon                    Version: 0.0.1      State: Not installed                           
        Install Method: Manual
    glpiinventory        Name: GLPI Inventory                 Version: 1.2.2      State: Enabled                                 
        Install Method: Manual
    importtools          Name: Import Tools                   Version: 1.0.0      State: Not installed                           
        Install Method: Manual
    sccm                 Name: Interface - SCCM               Version: 2.4.2      State: Not installed                           
        Install Method: Manual
    uninstall            Name: Item's Lifecycle (uninstall)   Version: 2.8.1      State: Not installed                           
        Install Method: Manual
    metademands          Name: Meta-Demands                   Version: 3.2.13     State: Not installed                           
        Install Method: Manual
    metabase             Name: Metabase                       Version: 1.3.0      State: Not installed                           
        Install Method: Manual
    mreporting           Name: More Reporting                 Version: 1.8.2      State: Not installed                           
        Install Method: Manual
    satisfaction         Name: More satisfaction              Version: 1.6.1      State: Not installed                           
        Install Method: Manual
    mygreatplugin        Name: MyGreatPlugin                  Version: 0.0.1      State: Not installed                           
        Install Method: Manual
    networkpanel         Name: networkpanel                   Version: 0.1.0      State: Not installed                           
        Install Method: Manual
    oauthimap            Name: Oauth IMAP                     Version: 1.4.3      State: Not installed                           
        Install Method: Manual
    oauthsso             Name: oauthsso                       Version: 1.9.2      State: Not installed                           
        Install Method: Manual
    genericobject        Name: Objects management             Version: 2.14.1     State: Installed / not activated               
        Install Method: Manual
    order                Name: Orders management              Version: 2.10.3     State: Not installed                           
        Install Method: Manual
    example              Name: Plugin Example                 Version: 0.0.1      State: Not installed                           
        Install Method: Manual
    localeoverride       Name: Rename GLPI strings            Version: 1.1.7      State: Not installed                           
        Install Method: Manual
    oid                  Name: SNMP OIDs list                 Version: 0.0.1      State: Not installed                           
        Install Method: Manual
    tag                  Name: Tag Management                 Version: 2.10.0     State: Not installed                           
        Install Method: Manual
    timelineticket       Name: Timeline of tickets            Version: 10.0+1.1   State: Not installed                           
        Install Method: Manual
    translate            Name: translate                      Version: 0.0.1      State: Not installed                           
        Install Method: Manual
    treeview             Name: Tree view                      Version: 1.10.1     State: Installed / not activated               
        Install Method: Manual
    vip                  Name: VIP                            Version: 1.8.2      State: Not installed                           
        Install Method: Manual
    webhook              Name: Webhook                        Version: 0.0.1      State: Not installed                           
        Install Method: Manual

Anything else?

No response

cconard96 commented 9 months ago

Maybe related to select2/select2#4010. Select2 doesn't have a built-in way to merge optgroup options when using pagination.