Skip to content

A null date field causes an error in a custom asset ([...]Failed to parse time string (null) at position 0 (n)[...]) #23977

@Aruileen85

Description

@Aruileen85

Code of Conduct

  • I agree to follow this project's Code of Conduct

Disable plugins

  • I reproduce the issue with all plugins disabled

Is there an existing issue for this?

  • I have searched the existing issues

Version

11.0.6

Bug description

In a custom asset, a "null" date field triggers a "Null invalide" error.

Image

Relevant log output

[2026-04-21 11:58:13] glpi.ERROR:   *** Caught DateMalformedStringException: Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database
  Backtrace :
  ./src/Html.php:157                                 
  ./src/Html.php:157                                 DateTime->__construct()
  ./src/Glpi/Search/Provider/SQLProvider.php:6615    Html::convDate()
  ./src/Glpi/Search/Provider/SQLProvider.php:5265    Glpi\Search\Provider\SQLProvider::giveItem()
  ./src/Glpi/Search/SearchEngine.php:678             Glpi\Search\Provider\SQLProvider::constructData()
  ./src/Glpi/Search/SearchEngine.php:693             Glpi\Search\SearchEngine::getData()
  ./src/Glpi/Search/SearchEngine.php:650             Glpi\Search\SearchEngine::showOutput()
  :                                                  Glpi\Search\SearchEngine::show()
  ...Application/View/Extension/PhpExtension.php:105 call_user_func_array()
  ...ates/cf/cf6553d28e978b66e1adbcc9d35af276.php:55 Glpi\Application\View\Extension\PhpExtension->call()
  ./vendor/twig/twig/src/Template.php:402            __TwigTemplate_0e36776edaa29840abd1aceafd1a234e->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()
  ./src/Glpi/Controller/AbstractController.php:68    Glpi\Application\View\TemplateRenderer->render()
  ./src/Glpi/Controller/GenericListController.php:51 Glpi\Controller\AbstractController->render()
  ./vendor/symfony/http-kernel/HttpKernel.php:181    Glpi\Controller\GenericListController->__invoke()
  ./vendor/symfony/http-kernel/HttpKernel.php:76     Symfony\Component\HttpKernel\HttpKernel->handleRaw()
  ./vendor/symfony/http-kernel/Kernel.php:208        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:71                              Symfony\Component\HttpKernel\Kernel->handle()

Page URL

https:///front/asset/asset.php?class=Vehicules

Steps To reproduce

  1. Create a custom asset with nullable date fields.
  2. Add data with empty date fields.
  3. Edit the asset list by adding a column for the date fields.
  4. The error will appear.

Example :

Image

Your GLPI setup information

<details><summary>
         GLPI information
      </summary><pre>
GLPI: 11.0.6 ( =&gt; /var/www/glpi)
Installation mode: TARBALL
Current language: fr_FR
Source Integrity: 5 files changed
  M: public/pics/logos/logo-G-100-white.png
  M: public/pics/logos/logo-GLPI-100-white.png
  M: public/pics/logos/logo-GLPI-250-black.png
  M: public/pics/logos/logo-GLPI-250-white.png
  A: public/pics/logos_backup.tar.gz
</pre></details><details><summary>
         Server
      </summary><pre>
Operating system: Linux lab-vm-glpiasc 6.17.13-2-pve #​1 SMP PREEMPT_DYNAMIC PMX 6.17.13-2 (2026-03-13T08:06Z) x86_64

PHP: 8.4.16 apache2handler

PHP extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, random, Reflection, SPL, session, standard, sodium, apache2handler, bz2, curl, FFI, ftp, fileinfo, gd, gettext, intl, ldap, mbstring, exif, shmop, sockets, zip, mysqlnd, PDO, xml, bcmath, calendar, ctype, dom, iconv, mysqli, pdo_mysql, Phar, posix, readline, SimpleXML, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, Zend OPcache

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

Web server: Apache/2.4.66 (Debian) (Apache/2.4.66 (Debian) Server at glpi.aurelien.lan Port 80)

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

Database:
   
Server Software: mariadb.org binary distribution
   
Server Version: 12.2.2-MariaDB-deb13
   
Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
   
Parameters: glpi_test@localhost:3306/glpidb11
   
Host info: Localhost via UNIX socket

Requirements:
PHP version (8.4.16) 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.2.2) is supported.
The log file has been created successfully.
Write access to /var/www/glpi/files/_cache has been validated.
Write access to /var/www/glpi/files/_cron has been validated.
Write access to /var/www/glpi/files has been validated.
Write access to /var/www/glpi/files/_graphs has been validated.
Write access to /var/www/glpi/files/_lock has been validated.
Write access to /var/www/glpi/files/_pictures has been validated.
Write access to /var/www/glpi/files/_plugins has been validated.
Write access to /var/www/glpi/files/_rss has been validated.
Write access to /var/www/glpi/files/_sessions has been validated.
Write access to /var/www/glpi/files/_tmp has been validated.
Write access to /var/www/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/www/glpi/marketplace has been validated.
Timezones seems loaded in database.
</pre></details><details><summary>
         GLPI constants
      </summary><pre>
GLPI_ROOT: &quot;/var/www/glpi&quot;
GLPI_VERSION: &quot;11.0.6&quot;
GLPI_SCHEMA_VERSION: &quot;11.0.6@84160e91f70f353b33495a7928e5b1476d4b6d98&quot;
GLPI_FILES_VERSION: &quot;11.0.6-15c577a4&quot;
GLPI_MIN_PHP: &quot;8.2&quot;
GLPI_MAX_PHP: &quot;8.5&quot;
GLPI_YEAR: &quot;2026&quot;
GLPI_I18N_DIR: &quot;/var/www/glpi/locales&quot;
GLPI_ENVIRONMENT_TYPE: &quot;production&quot;
GLPI_CONFIG_DIR: &quot;/var/www/glpi/config&quot;
GLPI_VAR_DIR: &quot;/var/www/glpi/files&quot;
GLPI_MARKETPLACE_DIR: &quot;/var/www/glpi/marketplace&quot;
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: false
GLPI_SERVERSIDE_URL_ALLOWLIST: [&quot;~^\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\\-._\\~!$&amp;&#39;()*+,;=:@]|%[0-9A-Fa-f]{2})* )*     # a path\n                        (?:\\? (?:[\\pL\\pN\\-._\\~!$&amp;&#39;\\[\\]()*+,;=:@/?]|%[0-9A-Fa-f]{2})* )?    # a query (optional)\n                    $~ixuD&quot;]
GLPI_DISALLOWED_UPLOADS_PATTERN: &quot;/\\.(php\\d*|phar)$/i&quot;
GLPI_TELEMETRY_URI: &quot;https://telemetry.glpi-project.org&quot;
GLPI_INSTALL_MODE: &quot;TARBALL&quot;
GLPI_NETWORK_MAIL: &quot;glpi@teclib.com&quot;
GLPI_NETWORK_SERVICES: &quot;https://services.glpi-network.com&quot;
GLPI_MARKETPLACE_ENABLE: 3
GLPI_MARKETPLACE_PRERELEASES: false
GLPI_MARKETPLACE_ALLOW_OVERRIDE: true
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true
GLPI_USER_AGENT_EXTRA_COMMENTS: &quot;&quot;
GLPI_DOCUMENTATION_ROOT_URL: &quot;https://links.glpi-project.org&quot;
GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: &quot;1&quot;
GLPI_LOG_LVL: &quot;warning&quot;
GLPI_SKIP_UPDATES: false
GLPI_STRICT_ENV: false
GLPI_AJAX_DASHBOARD: &quot;1&quot;
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_CENTRAL_WARNINGS: &quot;1&quot;
GLPI_SYSTEM_CRON: false
GLPI_TEXT_MAXSIZE: &quot;4000&quot;
GLPI_WEBHOOK_ALLOW_RESPONSE_SAVING: &quot;0&quot;
GLPI_WEBHOOK_CRA_MANDATORY: false
GLPI_ALTCHA_MODE: &quot;interactive&quot;
GLPI_ALTCHA_MAX_NUMBER: 50000
GLPI_ALTCHA_EXPIRATION_INTERVAL: &quot;PT20M&quot;
GLPI_DOC_DIR: &quot;/var/www/glpi/files&quot;
GLPI_CACHE_DIR: &quot;/var/www/glpi/files/_cache&quot;
GLPI_CRON_DIR: &quot;/var/www/glpi/files/_cron&quot;
GLPI_GRAPH_DIR: &quot;/var/www/glpi/files/_graphs&quot;
GLPI_LOCAL_I18N_DIR: &quot;/var/www/glpi/files/_locales&quot;
GLPI_LOCK_DIR: &quot;/var/www/glpi/files/_lock&quot;
GLPI_LOG_DIR: &quot;/var/www/glpi/files/_log&quot;
GLPI_PICTURE_DIR: &quot;/var/www/glpi/files/_pictures&quot;
GLPI_PLUGIN_DOC_DIR: &quot;/var/www/glpi/files/_plugins&quot;
GLPI_RSS_DIR: &quot;/var/www/glpi/files/_rss&quot;
GLPI_SESSION_DIR: &quot;/var/www/glpi/files/_sessions&quot;
GLPI_TMP_DIR: &quot;/var/www/glpi/files/_tmp&quot;
GLPI_UPLOAD_DIR: &quot;/var/www/glpi/files/_uploads&quot;
GLPI_INVENTORY_DIR: &quot;/var/www/glpi/files/_inventories&quot;
GLPI_THEMES_DIR: &quot;/var/www/glpi/files/_themes&quot;
GLPI_PLUGINS_DIRECTORIES: [&quot;/var/www/glpi/marketplace&quot;,&quot;/var/www/glpi/plugins&quot;]
GLPI_NETWORK_API_URL: &quot;https://services.glpi-network.com/api&quot;
GLPI_NETWORK_REGISTRATION_API_URL: &quot;https://services.glpi-network.com/api/registration/&quot;
GLPI_MARKETPLACE_PLUGINS_API_URI: &quot;https://services.glpi-network.com/api/marketplace/&quot;
</pre></details><details><summary>
         SQL replicas
      </summary><pre>
Not active
</pre></details><details><summary>
         Plugins list
      </summary><pre>
news                 Name: Alertes                        Version: 1.12.5       State: Enabled                                  Install Method: Marketplace
fields               Name: Champs supplémentaires         Version: 1.21.25      State: Error / to clean                         Install Method: Manual
datainjection        Name: Data Injection                 Version: 2.14.4       State: Enabled                                  Install Method: Marketplace
genericobject        Name: Gestion d&#39;objets               Version: 2.14.14      State: Error / to clean                         Install Method: Manual
</pre></details>

Anything else?

I reproduced the bug in a clean GLPI 11 instance as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions