Skip to content

An unexpected error occurred while adding Multiple dropdown without Default value #1077

Description

@michal1298

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

GLPI Version

11.0.2

Plugin version

1.23.0

Bug description

Hello.
When I go to a certificate created before adding custom fields, I get An unexpected error occurred message, and there are no Save or Put in trashbin buttons.

Image

The same error occurs when creating a new certificate. http://localhost/front/certificate.form.php?id=-1&withtemplate=2

Image

Relevant log output

/var/www/glpi/files/_log is empty

Chrome console output:
VM4898:380  GET http://localhost/ajax/common.tabs.php?_glpi_tab=Certificate%24main&formoptions=data-track-changes%3Dtrue&withtemplate=&_target=%2Ffront%2Fcertificate.form.php&_itemtype=Certificate&id=1 500 (Internal Server Error)
send @ jquery.js:9940
ajax @ jquery.js:9521
eval @ VM4898:380
obj.<computed> @ VM4898:181
__webpack_modules__.1437.jQuery.each.jQuery.<computed> @ jquery.js:9677
loadTabContents @ certificate.form.php?id=1:4983
(anonymous) @ certificate.form.php?id=1:5045
dispatch @ jquery.js:5145
(anonymous) @ jquery.js:4949
trigger @ jquery.js:8629
(anonymous) @ jquery.js:8707
each @ jquery.js:383
each @ jquery.js:205
trigger @ jquery.js:8706
trigger @ tabler.js:2198
complete @ tabler.js:5794
execute @ tabler.js:1961
executeAfterTransition @ tabler.js:1965
_queueCallback @ tabler.js:2384
_activate @ tabler.js:5798
show @ tabler.js:5775
(anonymous) @ tabler.js:5926
each @ jquery.js:383
each @ jquery.js:205
jQueryInterface @ tabler.js:5918
(anonymous) @ certificate.form.php?id=1:5050
mightThrow @ jquery.js:3489
(anonymous) @ jquery.js:3557
setTimeout
(anonymous) @ jquery.js:3602
fire @ jquery.js:3223
fireWith @ jquery.js:3353
fire @ jquery.js:3361
fire @ jquery.js:3223
fireWith @ jquery.js:3353
ready @ jquery.js:3844
completed @ jquery.js:3854


Docker logs:
[2025-11-06 13:30:07] glpi.CRITICAL:   *** Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("array_combine(): Argument #1 ($keys) must be of type array, string given") in "@fields/fields.html.twig" at line 142." at fields.html.twig line 142
  Backtrace :
  ./plugins/fields/templates/fields.html.twig:142
  ./vendor/twig/twig/src/Template.php:358            Twig\Template->yield()
  ./vendor/twig/twig/src/Template.php:373            Twig\Template->display()
  ./vendor/twig/twig/src/TemplateWrapper.php:51      Twig\Template->render()
  .../Glpi/Application/View/TemplateRenderer.php:170 Twig\TemplateWrapper->render()
  ./plugins/fields/inc/field.class.php:1271          Glpi\Application\View\TemplateRenderer->render()
  ./plugins/fields/inc/field.class.php:890           PluginFieldsField::prepareHtmlFields()
  ./plugins/fields/inc/field.class.php:987           PluginFieldsField::showDomContainer()
  ./src/Plugin.php:1775                              PluginFieldsField::showForTab()
  ...plication/View/Extension/PluginExtension.php:74 Plugin::doHook()
  ...ates/54/54d7a3397069c3346f27f02a7e8b120b.php:61 Glpi\Application\View\Extension\PluginExtension->callPluginHook()
  ./vendor/twig/twig/src/Template.php:402            __TwigTemplate_785b43510d78a4e1ae2eed87b8e34124->doDisplay()
  ./vendor/twig/twig/src/Template.php:358            Twig\Template->yield()
  ./vendor/twig/twig/src/Template.php:373            Twig\Template->display()
  ./vendor/twig/twig/src/TemplateWrapper.php:51      Twig\Template->render()
  .../twig/twig/src/Extension/CoreExtension.php:1520 Twig\TemplateWrapper->render()
  ...tes/0f/0f7f5665ae73bc31de21917cb9f55984.php:153 Twig\Extension\CoreExtension::include()
  ./vendor/twig/twig/src/Template.php:402            __TwigTemplate_de5cf828068e134b97b1cb14338dee9b->doDisplay()
  ...ates/be/bea2825e2468792e141130f1651776d7.php:52 Twig\Template->yield()
  ./vendor/twig/twig/src/Template.php:402            __TwigTemplate_0edd93c91cb1662aa36c676cd591efd4->doDisplay()
  ./vendor/twig/twig/src/Template.php:358            Twig\Template->yield()
  ./vendor/twig/twig/src/TemplateWrapper.php:61      Twig\Template->display()
  .../Glpi/Application/View/TemplateRenderer.php:188 Twig\TemplateWrapper->display()
  ./src/Certificate.php:564                          Glpi\Application\View\TemplateRenderer->display()
  ./src/CommonGLPI.php:683                           Certificate->showForm()
  ./ajax/common.tabs.php:108                         CommonGLPI::displayStandardTab()
  ...Glpi/Controller/LegacyFileLoadController.php:64 require()
  ./vendor/symfony/http-kernel/HttpKernel.php:181    Glpi\Controller\LegacyFileLoadController->__invoke()
  ./vendor/symfony/http-kernel/HttpKernel.php:76     Symfony\Component\HttpKernel\HttpKernel->handleRaw()
  ./vendor/symfony/http-kernel/Kernel.php:197        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:70                              Symfony\Component\HttpKernel\Kernel->handle()
  Previous: array_combine(): Argument #1 ($keys) must be of type array, string given
  ./src/Html.php:4558
  ./src/Html.php:4558                                array_combine()
  ./src/User.php:4335                                Html::jsAjaxDropdown()
  ...ication/View/Extension/ItemtypeExtension.php:99 User::dropdown()
  ...es/21/21aecc781ef4c24c27cb61b3c47b49f5.php:2151 Glpi\Application\View\Extension\ItemtypeExtension->getItemtypeDropdown()
  .../twig/twig/src/Extension/CoreExtension.php:2110 __TwigTemplate_77f954430d0fe2da2bcdfff449c9b189->{closure:{closure:__TwigTemplate_77f954430d0fe2da2bcdfff449c9b189::macro_dropdownField():2088}:2148}()
  ...es/21/21aecc781ef4c24c27cb61b3c47b49f5.php:2148 Twig\Extension\CoreExtension::captureOutput()
  .../twig/twig/src/Extension/CoreExtension.php:2110 __TwigTemplate_77f954430d0fe2da2bcdfff449c9b189->{closure:__TwigTemplate_77f954430d0fe2da2bcdfff449c9b189::macro_dropdownField():2088}()
  ...es/21/21aecc781ef4c24c27cb61b3c47b49f5.php:2088 Twig\Extension\CoreExtension::captureOutput()
  ...tes/ca/ca9887f178dd555d614f65a6443f9e16.php:320 __TwigTemplate_77f954430d0fe2da2bcdfff449c9b189->macro_dropdownField()
  ./vendor/twig/twig/src/Template.php:402            __TwigTemplate_9495aa2d5f9414b2b672567abb44f467->doDisplay()
  ./vendor/twig/twig/src/Template.php:358            Twig\Template->yield()
  ./vendor/twig/twig/src/Template.php:373            Twig\Template->display()
  ./vendor/twig/twig/src/TemplateWrapper.php:51      Twig\Template->render()
  .../Glpi/Application/View/TemplateRenderer.php:170 Twig\TemplateWrapper->render()
  ./plugins/fields/inc/field.class.php:1271          Glpi\Application\View\TemplateRenderer->render()
  ./plugins/fields/inc/field.class.php:890           PluginFieldsField::prepareHtmlFields()
  ./plugins/fields/inc/field.class.php:987           PluginFieldsField::showDomContainer()
  ./src/Plugin.php:1775                              PluginFieldsField::showForTab()
  ...plication/View/Extension/PluginExtension.php:74 Plugin::doHook()
  ...ates/54/54d7a3397069c3346f27f02a7e8b120b.php:61 Glpi\Application\View\Extension\PluginExtension->callPluginHook()
  ./vendor/twig/twig/src/Template.php:402            __TwigTemplate_785b43510d78a4e1ae2eed87b8e34124->doDisplay()
  ./vendor/twig/twig/src/Template.php:358            Twig\Template->yield()
  ./vendor/twig/twig/src/Template.php:373            Twig\Template->display()
  ./vendor/twig/twig/src/TemplateWrapper.php:51      Twig\Template->render()
  .../twig/twig/src/Extension/CoreExtension.php:1520 Twig\TemplateWrapper->render()
  ...tes/0f/0f7f5665ae73bc31de21917cb9f55984.php:153 Twig\Extension\CoreExtension::include()
  ./vendor/twig/twig/src/Template.php:402            __TwigTemplate_de5cf828068e134b97b1cb14338dee9b->doDisplay()
  ...ates/be/bea2825e2468792e141130f1651776d7.php:52 Twig\Template->yield()
  ./vendor/twig/twig/src/Template.php:402            __TwigTemplate_0edd93c91cb1662aa36c676cd591efd4->doDisplay()
  ./vendor/twig/twig/src/Template.php:358            Twig\Template->yield()
  ./vendor/twig/twig/src/TemplateWrapper.php:61      Twig\Template->display()
  .../Glpi/Application/View/TemplateRenderer.php:188 Twig\TemplateWrapper->display()
  ./src/Certificate.php:564                          Glpi\Application\View\TemplateRenderer->display()
  ./src/CommonGLPI.php:683                           Certificate->showForm()
  ./ajax/common.tabs.php:108                         CommonGLPI::displayStandardTab()
  ...Glpi/Controller/LegacyFileLoadController.php:64 require()
  ./vendor/symfony/http-kernel/HttpKernel.php:181    Glpi\Controller\LegacyFileLoadController->__invoke()
  ./vendor/symfony/http-kernel/HttpKernel.php:76     Symfony\Component\HttpKernel\HttpKernel->handleRaw()
  ./vendor/symfony/http-kernel/Kernel.php:197        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:70                              Symfony\Component\HttpKernel\Kernel->handle()

172.27.0.1 - - [06/Nov/2025:14:30:07 +0100] "GET /ajax/common.tabs.php?_glpi_tab=Certificate%24main&formoptions=data-track-changes%3Dtrue&withtemplate=&_target=%2Ffront%2Fcertificate.form.php&_itemtype=Certificate&id=1 HTTP/1.1" 500 57685 "http://localhost/front/certificate.form.php?id=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36"

Page URL

http://localhost/front/certificate.form.php?id=1

Steps To reproduce

  1. Create a Certificate
  2. Create a new block http://localhost/plugins/fields/front/container.php
  3. Set label; Insertion in the form (before save button); Associated item type: Management - Certificates
  4. Create a new field; set label; Type: Users; Multiple dropdown: Yes; Default value: leave empty; Active: Yes; Mandatory field: No; Read only: No.
  5. Go to certificate created in step 1. Error An unexpected error occurred, no Save and Put in trashbin buttons.
  6. Try to create a new one certificate: Error An unexpected error occurred, no Save button.

Your GLPI setup information

GLPI information
GLPI: 11.0.2 ( => /var/www/glpi)
Installation mode: DOCKER
Current language: en_GB
Source Integrity: OK
Server
Operating system: Linux 62a6da128557 6.6.87.2-microsoft-standard-WSL2 #​1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64

PHP: 8.4.14 apache2handler

PHP extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, hash, iconv, json,
mbstring, SPL, session, PDO, pdo_sqlite, bz2, posix, random, Reflection, standard, SimpleXML, tokenizer, xml, xmlreader,
xmlwriter, mysqlnd, apache2handler, apcu, bcmath, Phar, exif, gd, intl, ldap, mysqli, redis, soap, sodium, zip, Zend OPcache

Setup: disable_functions="" max_execution_time="30" max_input_vars="1000" memory_limit="128M" post_max_size="8M"
session.cookie_secure="0" session.cookie_httponly="1" session.cookie_samesite="Strict" session.save_handler="files"
upload_max_filesize="2M"

Web server: Apache ()

User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36

Database:

Server Software: mariadb.org binary distribution

Server Version: 12.1.1-MariaDB-ubu2404

Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Parameters: glpi@db:3306/glpi

Host info: db via TCP/IP

Requirements:
PHP version (8.4.14) is supported.
OS and PHP are relying on 64 bits integers.
Sessions configuration is OK.
Allocated memory is sufficient.
Following extensions are installed: dom, fileinfo, filter, libxml, simplexml, tokenizer, xmlreader,
xmlwriter.
mysqli extension is installed
curl extension is installed
gd extension is installed
intl extension is installed
mbstring extension is installed
zlib extension is installed
bcmath extension is installed
The constant
SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
openssl extension is installed
Database engine version (12.1.1) is supported.
The log file has been created successfully.
Write access to
/var/glpi/files/_cache has been validated.
Write access to /var/glpi/files/_cron has been validated.
Write access to /var/glpi/files has been validated.
Write access to /var/glpi/files/_graphs has been validated.
Write access to /var/glpi/files/_lock has been validated.
Write access to /var/glpi/files/_pictures has been validated.
Write access to /var/glpi/files/_plugins has been validated.
Write access to /var/glpi/files/_rss has been validated.
Write access to /var/glpi/files/_sessions has been validated.
Write access to /var/glpi/files/_tmp has been validated.
Write access to /var/glpi/files/_uploads has been validated.

Sessions configuration is secured.
exif extension is installed
ldap extension is installed
Following extensions are installed: bz2,
Phar, zip.
Zend OPcache extension is installed
Following extensions are installed:
ctype, iconv, sodium.
Write access to
/var/glpi/marketplace has been validated.
Timezones seems loaded in database.

GLPI constants
GLPI_ROOT: "/var/www/glpi"
GLPI_VERSION: "11.0.2"
GLPI_SCHEMA_VERSION: "11.0.2@ea2dbba0e1edbf5128d73bdb23c2c9b9f68468ba"
GLPI_FILES_VERSION: "11.0.2-e6b8e30d"
GLPI_MIN_PHP: "8.2"
GLPI_MAX_PHP: "8.5"
GLPI_YEAR: "2025"
GLPI_I18N_DIR: "/var/www/glpi/locales"
GLPI_CONFIG_DIR: "/var/glpi/config"
GLPI_VAR_DIR: "/var/glpi/files"
GLPI_MARKETPLACE_DIR: "/var/glpi/marketplace"
GLPI_LOG_DIR: "/var/glpi/logs"
GLPI_INSTALL_MODE: "DOCKER"
GLPI_ENVIRONMENT_TYPE: "production"
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: false
GLPI_SERVERSIDE_URL_ALLOWLIST: ["^\n (http|https|feed)://
# protocol\n (\n (?:\n
(?:xn--[a-z0-9-]++\.)*+xn--[a-z0-9-]++ # a domain name using punycode\n
|\n (?:[\pL\pN\pS\pM\-\]++\.)+[\pL\pN\pM]++ # a multi-level domain
name\n |\n [a-z0-9\-\
]++
# a single-level domain name\n )\.?\n |
# or\n \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
# an IP address\n | #
or\n \[\n
(?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?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:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::))))\n
\] # an IPv6 address\n
)\n (?:/ (?:[\pL\pN\pS\pM\-._\
!$&'()+,;=:@]|%[0-9A-Fa-f]{2}) )* # a path\n
(?:\? (?:[\pL\pN\-._\~!$&'\\+,;=:@/?]|%[0-9A-Fa-f]{2}) )? # a query (optional)\n
$~ixuD"]
GLPI_DISALLOWED_UPLOADS_PATTERN: "/\.(php\d*|phar)$/i"
GLPI_TELEMETRY_URI: "https://telemetry.glpi-project.org"
GLPI_NETWORK_MAIL: "glpi@teclib.com"
GLPI_NETWORK_SERVICES: "https://services.glpi-network.com"
GLPI_MARKETPLACE_ENABLE: 3
GLPI_MARKETPLACE_PRERELEASES: false
GLPI_MARKETPLACE_ALLOW_OVERRIDE: true
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true
GLPI_USER_AGENT_EXTRA_COMMENTS: ""
GLPI_DOCUMENTATION_ROOT_URL: "https://links.glpi-project.org"
GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: "1"
GLPI_LOG_LVL: "warning"
GLPI_SKIP_UPDATES: false
GLPI_STRICT_ENV: false
GLPI_AJAX_DASHBOARD: "1"
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_CENTRAL_WARNINGS: "1"
GLPI_SYSTEM_CRON: false
GLPI_TEXT_MAXSIZE: "4000"
GLPI_WEBHOOK_ALLOW_RESPONSE_SAVING: "0"
GLPI_WEBHOOK_CRA_MANDATORY: false
GLPI_ALTCHA_MODE: "interactive"
GLPI_ALTCHA_MAX_NUMBER: 50000
GLPI_ALTCHA_EXPIRATION_INTERVAL: "PT20M"
GLPI_DOC_DIR: "/var/glpi/files"
GLPI_CACHE_DIR: "/var/glpi/files/_cache"
GLPI_CRON_DIR: "/var/glpi/files/_cron"
GLPI_GRAPH_DIR: "/var/glpi/files/_graphs"
GLPI_LOCAL_I18N_DIR: "/var/glpi/files/_locales"
GLPI_LOCK_DIR: "/var/glpi/files/_lock"
GLPI_PICTURE_DIR: "/var/glpi/files/_pictures"
GLPI_PLUGIN_DOC_DIR: "/var/glpi/files/_plugins"
GLPI_RSS_DIR: "/var/glpi/files/_rss"
GLPI_SESSION_DIR: "/var/glpi/files/_sessions"
GLPI_TMP_DIR: "/var/glpi/files/_tmp"
GLPI_UPLOAD_DIR: "/var/glpi/files/_uploads"
GLPI_INVENTORY_DIR: "/var/glpi/files/_inventories"
GLPI_THEMES_DIR: "/var/glpi/files/_themes"
GLPI_PLUGINS_DIRECTORIES: ["/var/glpi/marketplace","/var/www/glpi/plugins"]
GLPI_NETWORK_REGISTRATION_API_URL: "https://services.glpi-network.com/api/registration/"
GLPI_MARKETPLACE_PLUGINS_API_URI: "https://services.glpi-network.com/api/marketplace/"
SQL replicas
Not active
Notifications
Way of sending emails: PHP
Plugins list
fields               Name: Additional fields              Version: 1.23.0     State: Enabled
Install Method: Manual
cmdb Name: CMDB Version: 3.1.2 State: Installed / not activated
Install Method: Manual

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions