Bug 32790 - "Mail Merge > Send via mail" uses mailaddress from first record for all records
Summary: "Mail Merge > Send via mail" uses mailaddress from first record for all records
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.3.0 RC1
Hardware: x86 (IA32) Linux (All)
: medium critical
Assignee: Caolán McNamara
URL:
Whiteboard: target:3.3
Keywords: regression
Depends on:
Blocks:
 
Reported: 2011-01-03 01:10 UTC by Cor Nouws
Modified: 2011-01-15 06:06 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
odb to register and fill with some mail addresses of your own/friends (3.74 KB, application/vnd.oasis.opendocument.database)
2011-01-07 06:08 UTC, Cor Nouws
Details
document with fields (8.66 KB, application/vnd.oasis.opendocument.text)
2011-01-07 06:10 UTC, Cor Nouws
Details
very trivial patch to fix this (1.33 KB, patch)
2011-01-08 15:16 UTC, Kohei Yoshida
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2011-01-03 01:10:03 UTC
- do mailmerge with few rows in a spreadsheet
 (including a mail address
  best is to use different mail accounts of your own in the various records)

- choose to send via mail
 (as text or as PDF)

 > all mails are send to the mail address from the first record

(the resulting document on screen does show the correct address for each merged document)
Comment 1 Jan Holesovsky 2011-01-03 10:03:18 UTC
Cor: Can you please attach an example document to ease the debugging?  Thank you!
Comment 2 Cor Nouws 2011-01-03 12:47:27 UTC
Hi Kendy,

Well, I can provide a simple .odb, that you need to register, add you own mail-addresses..
Of course plus an .odt with some fields dragged from the datasource window...

But I expect that it is just as easy if you have sour own little test-DB already hanging around?

(BTW, this bug caused 430 different document to be send to one mailbox :-\ ..That person will never speak to me again, probably ;-) )
Comment 3 Cor Nouws 2011-01-07 06:08:45 UTC
Created attachment 41744 [details]
odb to register and fill with some mail addresses of your own/friends
Comment 4 Cor Nouws 2011-01-07 06:10:15 UTC
Created attachment 41745 [details]
document with fields

Hi,

Just installed rc2.
The problem is still there.

Simple .odb and .odt for reproducing attached.

Will add this one on the stopper issue
Comment 5 Michael Meeks 2011-01-07 08:23:23 UTC
Kohei - any chance this is some trivial thinko ? Cor - if not, I think we need to punt this to 3.3.1.
Comment 6 Cor Nouws 2011-01-07 14:56:18 UTC
(In reply to comment #5)
> Kohei - any chance this is some trivial thinko ? 

It is not a problem in the mailmerge.py from Caolan.
Tested with that file from OOo installation.
It works OK in OOo330rc8, so is a problem in LibO code.

> Cor - if not, I think we need to punt this to 3.3.1.

Do we have a good way to warn users: do not use this software to mail-merge your relatives ? 
(Imagine, Jeannet reading my mails for Sophie, Christine, Marijke ... ;-) )
Comment 7 Kohei Yoshida 2011-01-07 15:13:13 UTC
I have no prior experience with this feature, so it'll take some time for me to dig in.  With 3.3 just around the corner (or so I hear), I'm not sure if we have any time left to do anything for this...
Comment 8 Cor Nouws 2011-01-08 14:48:31 UTC
(In reply to comment #7)
> I have no prior experience with this feature, so it'll take some time for me to
> dig in.  With 3.3 just around the corner (or so I hear), I'm not sure if we
> have any time left to do anything for this...

I understand the situation, but as explained before, I expect serious problems if people use this feature while the bug is there.
Comment 9 Kohei Yoshida 2011-01-08 15:09:27 UTC
Ah, I found it.  Someone accidentally removed the line that would move to the next record during mail merge as part of a code cleanup.  It's a trivial fix.  I'll attach a patch shortly for review.
Comment 10 Kohei Yoshida 2011-01-08 15:16:00 UTC
Created attachment 41779 [details]
very trivial patch to fix this

This patch will bring the code back to before the unintended change was introduced.
Comment 11 Cor Nouws 2011-01-08 15:37:06 UTC
Thanks Kohei :-)
Comment 12 Caolán McNamara 2011-01-09 06:09:18 UTC
Looks good, reviewed and pushed.
Comment 13 Don't use this account, use tml@iki.fi 2011-01-10 03:58:02 UTC
Ah, nice catch.

At first I thought I had caused the bug but looking more closely at git history I see it wasn't me;) But it could as well have been me.

Lesson learned: Don't initialise a variable with a *very* side-effectful function call if that variable is then going to be used only in an assertion or other debugging statement. It makes it likely that somebody might later accidentally put also the function call inside an ifdef, thinking that the variable is unused in a non-debugging compilation.
Comment 14 Michael Meeks 2011-01-10 03:59:50 UTC
nice work Kohei ! :-) thanks ...
Comment 15 sophie 2011-01-15 06:06:01 UTC
Verified in RC3 - Closed - Sophie