You are not logged in.
Pages: 1
I have upgraded to version 10 but I think this started with the update to 9.5.5. Whenever we view a ticket we get these popups about an invalid time. The time referenced is from the ticket logs. I have tried all sorts of things including setting the time zone in the DB, ran the migration tool, and converted to timestamps. Nothing has worked.
I have run these:
sudo -u www-data php ./bin/console glpi:migration:build_missing_timestamps
sudo -u www-data php ./bin/console glpi:migration:timestamps
SELECT @@GLOBAL.time_zone, @@SESSION.time_zone; output is US/Eastern which is accurate.
config_db.php:
public $allow_datetime = false;
public $use_timezones = true;
SAMPLE ERRORS:
04-26-2022 14:30 Invalid
04-26-2022 14:29 Invalid
04-26-2022 14:29 Invalid
04-26-2022 14:11 Invalid
04-26-2022 14:11 Invalid
04-26-2022 16:31 Invalid
HELP
Offline
Are those the full error messages?
Is there anything more in the files/_log/php-errors.log or files/_log/sql-errors.log files?
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Just found this:
glpiphplog.CRITICAL: *** Uncaught Exception Exception: DateTime::__construct(): Failed to parse time string (11-18-2021 08:33) at position 0 (1): Unexpected character in /<path>/glpi-10.0.0/src/Html.php at line 193
Offline
It does seem like that isn't a valid timestamp that is understandable by the DateTime class according to the PHP documentation.
https://www.php.net/manual/en/datetime.formats.date.php
Was there a full stack trace under this error in the log? It is difficult to know where this invalid date is coming from.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
[2022-04-27 08:35:59] glpiphplog.CRITICAL: *** Uncaught Exception Exception: DateTime::__construct(): Failed to parse time string (09-23-2021 06:24) at position 0 (0): Unexpected character in /<abspath>/glpi-10.0.0/src/Html.php at line 193
Backtrace :
src/Html.php:193 DateTime->__construct()
src/Html.php:236 Html::convDate()
...tion/View/Extension/DataHelpersExtension.php:77 Html::convDateTime()
...a01b37349b8c47db225f1ddfe8d22768fa0d0a2e.php:44 Glpi\Application\View\Extension\DataHelpersExtension->getFormattedDatetime()
vendor/twig/twig/src/Template.php:394 __TwigTemplate_b68ccfb3bc2c56751d0d77526089bdad74f9fc438ab8920c3a5562c0c48b9613->doDisplay()
vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling()
vendor/twig/twig/src/Template.php:379 Twig\Template->display()
vendor/twig/twig/src/TemplateWrapper.php:40 Twig\Template->render()
.../twig/twig/src/Extension/CoreExtension.php:1323 Twig\TemplateWrapper->render()
...8e5981cbf7ea7295ae38f5fb9081a194ec696a85.php:47 twig_include()
vendor/twig/twig/src/Template.php:394 __TwigTemplate_6d289ca10a32ff87526faa9e0bc482b24fece8625c678f5679ffc83f75ffe7f4->doDisplay()
vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling()
vendor/twig/twig/src/Template.php:379 Twig\Template->display()
vendor/twig/twig/src/TemplateWrapper.php:40 Twig\Template->render()
.../twig/twig/src/Extension/CoreExtension.php:1323 Twig\TemplateWrapper->render()
...ca1c631f13444c7594896a029f47523c78dcdec.php:358 twig_include()
vendor/twig/twig/src/Template.php:394 __TwigTemplate_1e1198879fbd0c06c7e0db16ce468f4914380c22370189de1115ee03154bb832->doDisplay()
vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling()
vendor/twig/twig/src/Template.php:379 Twig\Template->display()
vendor/twig/twig/src/TemplateWrapper.php:40 Twig\Template->render()
.../twig/twig/src/Extension/CoreExtension.php:1323 Twig\TemplateWrapper->render()
...d3c9f76b12418241e2133f86297747b67793f08.php:128 twig_include()
vendor/twig/twig/src/Template.php:394 __TwigTemplate_971f426d454ebf589dfa8dc04ef6330eb84abf7e027812b77a366b6ffba9dc21->doDisplay()
vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling()
vendor/twig/twig/src/TemplateWrapper.php:47 Twig\Template->display()
src/Application/View/TemplateRenderer.php:177 Twig\TemplateWrapper->display()
src/Ticket.php:4397 Glpi\Application\View\TemplateRenderer->display()
src/CommonGLPI.php:655 Ticket->showForm()
ajax/common.tabs.php:107 CommonGLPI::displayStandardTab()
Last edited by amurray (2022-04-27 14:36:53)
Offline
I am having exactly the same problem and exactly the same error. Did anyone get a resolution for this?
Thanks!
G.
Glpi: 10.0.1
Offline
Ok. I just noticed that if under personalization the "Date format" is set to MM-DD-YYYY that is when the problem occurs. If I change the "Date format" to YYYY-MM-DD then these errors do not appear anymore.
I, of course, would prefer to display dates as MM-DD-YYYY for my USA user base.
G.
Glpi: 10.0.1
Offline
I am on GLPI 10.0.1, btw. I just updated my signature on this forum.
Glpi: 10.0.1
Offline
Pages: 1