You are not logged in.
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
GLPI 9.5.1 CentOS
Offline
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.
Debian 11.7 - PHP 7.4.33 - MariaDB 10.5.19 - 10.0.8-dev
Offline
Oh, you're right, I made a mistake in function name writing this post. Correct function name is: is_numeric() . Sorry.
GLPI 9.5.1 CentOS
Offline
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 ;-)
Debian 11.7 - PHP 7.4.33 - MariaDB 10.5.19 - 10.0.8-dev
Offline
I also have problems with the recurrent ticket version 9.4.4.
I have several recurrent tickets that should be repeated every 1 month, since version 9.4.3 it will not work correctly for me.
GLPI 9.4.4 + FusionInventory 9.4+1.1 on Ubuntu 18.04
Offline
Hello alientm,
because some changes in my work actually I don't work with glpi ;-(
Only "play" a little with the 9.5 at home. As I can see this little bug is still present in 9.5.
Did you have made the little changes in inc/ticketrecurrent.class.php?
Pls edit the line 343 as described.
Debian 11.7 - PHP 7.4.33 - MariaDB 10.5.19 - 10.0.8-dev
Offline
Should be:
is_number()
or
is_numeric()
in place of is_int() ?
GLPI 9.4.4 + FusionInventory 9.4+1.1 on Ubuntu 18.04
Offline
Any help ?
GLPI 9.4.4 + FusionInventory 9.4+1.1 on Ubuntu 18.04
Offline
Hello alientm,
because some changes in my work actually I don't work with glpi ;-(
Only "play" a little with the 9.5 at home. As I can see this little bug is still present in 9.5.Did you have made the little changes in inc/ticketrecurrent.class.php?
Pls edit the line 343 as described.
hello guys,
I'm using GLPI 9.4.4 with MariaDB.
and I am exactly with the same problem, during testing the recurring tickets worked, but in production the date is not respected ...
I tried to fix the problem as described above, but in my version it is a little different and I am not php programmer, could they help me ?
@Lagundo and @grajek
below I copied the contents of line 343 to 365 of the file inc/ticketrecurrent.class.php
if ($periodicity <> 0) {
// Standard time computation
$timestart = strtotime($begin_date) - $create_before;
$now = time();
if ($now > $timestart) {
$value = $periodicity;
$step = "second";
if (preg_match('/([0-9]+)MONTH/', $periodicity, $matches)) {
$value = $matches[1];
$step = 'MONTH';
} else if (preg_match('/([0-9]+)YEAR/', $periodicity, $matches)) {
$value = $matches[1];
$step = 'YEAR';
} else {
if (($value%DAY_TIMESTAMP)==0) {
$value = $value/DAY_TIMESTAMP;
$step = "DAY";
} else {
$value = $value/HOUR_TIMESTAMP;
$step = "HOUR";
Offline
343 to 347 but code is from glpi
if (!is_string($periodicity) && !preg_match('/^\d+$/', $periodicity)
&& !preg_match($periodicity_pattern, $periodicity)) {
// Invalid periodicity.
return 'NULL';
}
and work for me
GLPI 9.4.4 + FusionInventory 9.4+1.1 on Ubuntu 18.04
Offline