Skip to Content.
Sympa Menu

devel - RE: [sympa-dev] Ssummary URL reference error; wrong month

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: address@concealed
  • To: address@concealed
  • Cc: address@concealed
  • Subject: RE: [sympa-dev] Ssummary URL reference error; wrong month
  • Date: Thu, 31 Jan 2002 16:32:41 +0100

Title: RE: [sympa-dev] Ssummary URL reference error; wrong month

I found in the CVS Version 1.193 of List.pm with the modified do_arcsearch routine (search in current mounth and in the previous none empty one). Your smart solution is also suitably for my old problem with the wrong summary url. I took your idea and modify the do_arcsearch_id routine. The following patch to List.pm works with Sympa Verion 3.2.1-3 (debian):



diff -u wwsympa.fcgi.save wwsympa.fcgi
--- wwsympa.fcgi.save   Mon Nov 12 14:02:23 2001
+++ wwsympa.fcgi        Thu Jan 31 15:54:42 2002
@@ -3339,7 +3339,24 @@

     $search->archive_name ($in{'archive_name'});

-    $search->directories ($search->archive_name);
+    unless (defined($in{'archive_names'})) {
+       # by default search in current mounth and in the previous none empty one
+       my $search_base = $search->search_base;
+       my $previous_active_dir ;
+       opendir ARC, "$search_base";
+       foreach my $dir (sort {$b cmp $a} grep(!/^\./,readdir ARC)) {
+           if ($dir =~ /^(\d{4})-(\d{2})$/) {
+               if ($dir lt $search->archive_name) {
+                       $previous_active_dir = $dir;
+                       last;
+               }
+           }
+       }
+       closedir ARC;
+       $in{'archive_name'} = $search->archive_name."\0".$previous_active_dir ;
+    }
+
+    $search->directories ($in{'archive_name'});

     ## User didn't enter any search terms
     if ($in{'key_word'} =~ /^\s*$/) {


It works fine! I inserted the "last" statement in the loop, because the do_arcsearch_id routine doesn'nt stop with the search at the previous month. It seems to me, that the routine search the whole archive, without the "last".

Herbert



-----Original Message-----
From: Olivier Salaun
Cc: 'address@concealed'
Sent: 11/7/01 3:40 PM
Subject: Re: [sympa-dev] Ssummary URL reference error; wrong month

> Straub Herbert wrote:
>
> In sympa 3.2.1 (and later) there is an error with the subscriber
option summary.
>
> If the month change between two summary mail sendings, then the URL in
the summary mail
> to the mail, is wrong. I think, the error occurs also, if the year
change.

> The URL specification is wrong. If i changed the URL path 2001-11 to
2001-10 it works.
>
> In List.pm i found in the function send_msg_digest in loop index
contruction the line
>
>  $msg->{'month'} = &POSIX::strftime("%Y-%m", localtime(time)); ##
Should be extracted from Date:

> I change this line with the following lines:
>
> my $send_date;
> $send_date=ParseDate($mail->head->get('date'));
>
> and it seems, that it works correct. At the beginning of List.pm you
must add
>
> use Date::Manip;
>
> Is this a correct solution?

You solution has 2 disadvantages :
        1/ it requires a new CPAN module 'Date::Manip' and Sympa already
suffers
          from the amount of required CPAN modules.

        2/ archived.pl does NOT use the Date: SMTP header field to
determine
           in which directory to store the mail. It uses the current
date
           instead.

Another cheap and efficient solution is to hard-code in arcsearch_id
that it
should search for the message in the provided month and the previous
one.

--
Olivier Salaün
Comité Réseau des Universités



  • RE: [sympa-dev] Ssummary URL reference error; wrong month, herbert . straub, 01/31/2002

Archive powered by MHonArc 2.6.19+.

Top of Page