You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2022-12-13 03:33:18

haiha298
Member
Registered: 2022-12-08
Posts: 7

How to fix this notification

Dear sir
this morning i get this notification from ticket. can you guide me how to fix it?
"Information
  12-13-2022 08:17 Invalid
12-13-2022 08:08 Invalid
12-13-2022 08:06 Invalid
12-13-2022 08:04 Invalid"

Offline

#2 2022-12-20 07:53:07

haiha298
Member
Registered: 2022-12-08
Posts: 7

Re: How to fix this notification

Dear sirs
after i create a ticket also appear the invalid notice, can you help me fix this?

Offline

#3 2023-08-30 16:59:01

gryfalco22
Member
Registered: 2023-08-30
Posts: 1

Re: How to fix this notification

I have figured a way to make that notification disappear. It is triggered by the GLPI_ROOT/src/Html.php function called convDate(). If you look this portion of the file (in my case, 200 since I am using the latest GLPI version at the time of this post):

        try {
            $date = new \DateTime($time);
        } catch (\Throwable $e) {
            ErrorHandler::getInstance()->handleException($e);
            Session::addMessageAfterRedirect(
                sprintf(
                    __('%1$s %2$s'),
                    $time,
                    _x('adjective', 'Invalid')
                )
            );
           
            return $time;

Comment out the "Session::addMessageAfterRedirect(" to the ");" before return $time; using */ and /* and the error will go away. I think the issue is that there is a problem with the date conversion if you set the time to a different format in GLPI. If not I am not sure if that is causing the problem, but at least my method provides a workaround.

Offline

#4 2023-11-15 14:21:41

ishr-hds-glpi
Member
Registered: 2023-11-08
Posts: 2

Re: How to fix this notification

Hi fellas,
writing from the German IT department... :-)
Here, we use the default date format DD-MM-YYYY. However, our GLPI Instance was still set to MM-DD-YYYY
I had the same issue and after setting it to DD-MM-YYYY the Notification went away. Thanks to gryfalco22's detailed description, I was able to fix this even without the Workaround.

Have a good day!

Offline

#5 2023-11-16 01:09:49

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,813
Website

Re: How to fix this notification

Hello,

This will be fixed in GLPI 10.0.11. The issue is with the historical entries in the timeline which are hidden by default, which already have their date converted to the user's preference but try to have it converted again during the display of the timeline which cannot be done with the DD-MM-YYYY format.

https://github.com/glpi-project/glpi/pull/15901


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

#6 2023-11-17 18:18:10

sIBajHYG
Member
From: Mission [KS]
Registered: 2023-08-18
Posts: 75

Re: How to fix this notification

gryfalco22 wrote:

I have figured a way .......................my method provides a workaround.

TOP solution! Thank you!


Linux ubuntu-22.04.2-live-server-amd64, PHP 8.1.2, Apache 2.4.52, MariaDB 10.6.12, GLPI 10.0.15.
GLPI Inventory 1.3.5, PHP SAML 1.3.0,  Oauth IMAP 1.4.3, Additional Fields, 1.21.8,Ticket Cleaner.

Offline

Board footer

Powered by FluxBB