Notes |
(0022770)
michiel (administrator)
22-01-07 17:38
|
ah, interesting one. I don't use that functionality, so I didn't check it for ages. Might be useful to try to debug it and post your findings. |
|
(0022774)
meteo (reporter)
22-01-07 18:33
|
Michiel,
I am very bad in PHP coding, in particular touching a brand new connect.php.
I have seen that you have rewritten that part, maybe there is some small typo... |
|
(0022781)
michiel (administrator)
22-01-07 22:50
|
I haven't touched that code for a long time, so I can't imagine it broke. Have you upgraded Mysql as well? It may have to do with mysql changing their date formatting codes. |
|
(0022789)
meteo (reporter)
23-01-07 11:36
|
we are using MySQL5.0.26. Bu I have seen that the now() function used in the connect.php code returns the same format in MySQL 3.23.49 we were using before.
This shouldn't matter anyway as the dates passed with the configured array to the excludedDateForRepetition function contains also the format:
$repeat_exclude = array(
array("format" => "%a", "values" => array("Sun","Sat")),
array("format" => "%d-%m-%Y", "values" => array("26-12-2007","25-12-2007","06-04-2007","09-04-2007","0
1-05-2007","25-01-2007")),); |
|
(0022790)
meteo (reporter)
23-01-07 12:09
|
a format query in both databases returns the same result:
SELECT date_format( now(), "%a")
Tue |
|
(0022791)
meteo (reporter)
23-01-07 13:15
|
I have found where the problem is:
MySQL5 stores ALL dates as %Y-%m-%d %H:%i:%s, so adding time to the old format.
What happens is that each loop that check the exclusion takes the new embargo from DB with
while (excludedDateForRepetition($msgdata["newembargo"]))
so the logical expression
foreach ($GLOBALS["repeat_exclude"] as $exclusion) {
$formatted_value = Sql_Fetch_Row_Query(sprintf('select date_format("%s","%s")',$date,$exclusion["format"]));
foreach ($exclusion["values"] as $disallowed) {
if ($formatted_value[0] == $disallowed) {
return 1;
is always TRUE during the same day, as the $formatted_value is always changing the time part and the foreach is triggered by newembargo changes.
I think somewhere newembargo should be reformatted as well..... |
|
(0022793)
meteo (reporter)
23-01-07 13:50
|
ISSUE SOLVED!
please discard my last notes, the wrong piece of code is the following (don't know why you changed the variable name....):
while (excludedDateForRepetition($msgdata["newembargo"])) {
$repeat += $msgdata["repeatinterval"];
should be instead:
while (excludedDateForRepetition($msgdata["newembargo"])) {
$repeatinterval += $msgdata["repeatinterval"];
I think this can be easily fixed in your code, I will do myself on our installation |
|
(0022795)
michiel (administrator)
23-01-07 14:32
|
fantastic, thanks for finding it. |
|
(0030021)
hernan (developer)
02-08-07 19:49
|
Resolved appliying fix by meteo |
|