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 2019-07-10 09:41:21

grajek
Guest
Registered: 2015-03-16
Posts: 59

9.4.3 recurrent ticket is not created when periodicity is hours/days

Hello!
After upgrade from 9.1.6 and MySql to MariaDB I had a problem with recurrent tickets that weren't created when periodicity was set to hour or days. It didn't come up in tests, because first occurence did show up, problem was with next occurrences. After investigation I found out that in database glpi_ticketrecurrents.next_creation_date field was not being set. Updating this field manually triggered ticket creation, but only once. After inserting some debug lines in inc/ticketrecurrent.class.php I found out that method computeNextCreationDate() was failing periodicity check:

      
343      if (!is_int($periodicity) && !preg_match($periodicity_pattern, $periodicity)) {
344         // Invalid periodicity.
345         return 'NULL';
346      }

The culprit is is_int() function, that checks if variable is of type int, which is not - it's a string containing valid int.
After replacing it with is_number() everything went back to normal smile


GLPI 9.4.3 CentOS

Offline

#2 2019-07-13 14:58:53

Langundo
Guest
Registered: 2016-07-21
Posts: 62

Re: 9.4.3 recurrent ticket is not created when periodicity is hours/days

Hello grajek,
thank for your work to find the bug.
Have trouble with my recurrent tickets too. So I decide to use your solution but then I edit recurrent tickets or start automatic action ticketcurrent the web IF hangs (shows a blank page)
After a little try and error I found that the (!is_string($periodicity) seems to work for me.
But I'm not fit in php so maybe you (or someone else) can have a look at this.

Thanks. wink


work: Debian 9.5 - PHP 7.0.30 - MariaDB 10.1.26 - GLPI 9.4.3
test: sometimes with bugfix / master

Offline

#3 2019-07-13 22:28:12

grajek
Guest
Registered: 2015-03-16
Posts: 59

Re: 9.4.3 recurrent ticket is not created when periodicity is hours/days

Oh, you're right, I made a mistake in function name writing this post. Correct function name is: is_numeric() . Sorry.


GLPI 9.4.3 CentOS

Offline

#4 2019-07-15 13:28:48

Langundo
Guest
Registered: 2016-07-21
Posts: 62

Re: 9.4.3 recurrent ticket is not created when periodicity is hours/days

Have edit the function.

After update to 9.4.3 the ticketrecurrent works (as you wrote) one time. So i didn't think there is a problem with glpi and was loocking for some mismatch configs in my settings.
Never I had the idea to look in database.

So I have to say well done and thank you again ;-)


work: Debian 9.5 - PHP 7.0.30 - MariaDB 10.1.26 - GLPI 9.4.3
test: sometimes with bugfix / master

Offline

Board footer

Powered by FluxBB