phplist

NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1


View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008998phplist applicationRepetitionpublic22-01-07 17:1118-02-08 14:08
Reportermeteo 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
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.
Attached Files? file icon config.php [^] (29,624 bytes) 22-01-07 17:11

- Relationships Relation Graph ] Dependency Graph ]
related to 0003721closed phplist 2.10.x 

-  Notes
(0022770)
michiel (manager)
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 (manager)
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 (manager)
23-01-07 14:32

fantastic, thanks for finding it.
(0030021)
user1308
02-08-07 20:49

Resolved appliying fix by meteo


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker