View Issue Details

IDProjectCategoryView StatusLast Update
0008998phpList 3 applicationRepetitionpublic18-02-08 14:08
Reportermeteo Assigned To 
Status resolvedResolutionfixed 
Product Version2.10.4 
Target Version2.10.7Fixed in Version2.10.5 
Summary0008998: Unable to find new embargo date too many exclusions?
DescriptionI am trying to use the repetition excluding weekends and bank holidays as stated in the documentation.
I was using a previous version (2.6.5-RC1) with this feature and was working fine.
Now we migrated to the new version but this feature hasn't worked ever since.
Additional InformationI am attaching the config file we are using.
I tried with and without the comma at the end of the second array but without success.
TagsNo tags attached.


related to 0003721 closed phplist 2.10.x 


22-01-07 17:11


config.php (29,624 bytes)


22-01-07 17:38

administrator   ~0022770

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.


22-01-07 18:33

reporter   ~0022774


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...


22-01-07 22:50

administrator   ~0022781

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.


23-01-07 11:36

reporter   ~0022789

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


23-01-07 12:09

reporter   ~0022790

a format query in both databases returns the same result:
SELECT date_format( now(), "%a")


23-01-07 13:15

reporter   ~0022791

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.....


23-01-07 13:50

reporter   ~0022793


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


23-01-07 14:32

administrator   ~0022795

fantastic, thanks for finding it.


02-08-07 20:49


Resolved appliying fix by meteo