Bug 120758 - A field remains empty if the "Then" field contains several points (Mail Merge conditional text)
Summary: A field remains empty if the "Then" field contains several points (Mail Merge...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Mail-Merge Fields
  Show dependency treegraph
 
Reported: 2018-10-21 20:52 UTC by Nawar Aldanaf
Modified: 2019-01-16 14:23 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test case db (3.37 KB, application/vnd.sun.xml.base)
2018-10-27 09:08 UTC, Oliver Brinzing
Details
test case document (9.09 KB, application/vnd.oasis.opendocument.text)
2018-10-27 09:08 UTC, Oliver Brinzing
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nawar Aldanaf 2018-10-21 20:52:24 UTC
Description:
Suppose you want to Mail Merge and to insert a new field with a condition (insert → Field → more Fields → Functions → conditional text).
In the field "Condition": [testdb.Sheet1.Title]=="Engineer"
In the field "Then": Prof. Dr. Eng.
After printing the document, you should see the text Prof. Dr. Eng. if the condition is true. But it remains empty, because it contains several points. I tested it without points and it worked!

Steps to Reproduce:
1.insert → Field → more Fields → Functions → conditional text
2.In the field "Condition": [testdb.Sheet1.Title]=="Engineer"
3.In the field "Then": Prof. Dr. Eng.
4.Print the document and click yes when you see the dialog (Your document contains address database fields. Do you want to print a form letter?).
5.Open the exported file and see the results!

Actual Results:
The field remains empty. 
The text would be printed only if the field "Then" doesn't contain this points.

Expected Results:
The inserted field should contain Prof. Dr. Eng.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 5.2.7.2
Build ID: 1:5.2.7-1+deb9u4
CPU Threads: 8; OS Version: Linux 4.9; UI Render: default; VCL: gtk2; 
Locale: en-US (en_US.utf8); Calc: group
Comment 1 Oliver Brinzing 2018-10-27 09:07:54 UTC
reproducible with:

Version: 6.1.3.1 (x64)
Build-ID: a9670562c26181ec3afbe381c9ff499ae88c98b7
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc:
Comment 2 Oliver Brinzing 2018-10-27 09:08:22 UTC
Created attachment 146054 [details]
test case db
Comment 3 Oliver Brinzing 2018-10-27 09:08:47 UTC
Created attachment 146055 [details]
test case document
Comment 4 Xisco Faulí 2018-10-30 11:22:18 UTC
it works if no dots are used...
Comment 5 Xisco Faulí 2018-10-30 11:24:03 UTC
Also reproduced in Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 6 Xisco Faulí 2018-10-30 11:28:14 UTC
(In reply to Xisco Faulí from comment #4)
> it works if no dots are used...

So it happens if more than one dot is used. Same behaviour with the else statement
Comment 7 Xisco Faulí 2018-10-30 12:26:34 UTC
I guess LibreOffice assumes if there's more than a dot the string points to a table in a database like we would do with test_case.Contacts.Title=="Engineer".
Obviously, as Prof. Dr. Eng. doesn't exist, it prints an empty string. My 2 cents...

@Jan-Marek, I thought you could be interested in this issue...
Comment 8 Nawar Aldanaf 2018-10-30 14:11:03 UTC
@Oliver Brinzing 
I could not open the attachments.

So what can I do now? Is not that a bug?
Comment 9 Oliver Brinzing 2018-10-30 17:36:20 UTC
(In reply to Nawar Aldanaf from comment #8)
> I could not open the attachments.

i have no problems downloading the attachments.
maybe a problem with your internet connection/firewall ?
Comment 10 Nawar Aldanaf 2018-10-30 18:10:46 UTC
(In reply to Oliver Brinzing from comment #9)
> (In reply to Nawar Aldanaf from comment #8)
> > I could not open the attachments.
> 
> i have no problems downloading the attachments.
> maybe a problem with your internet connection/firewall ?

No problem with internet/firewall . I have downloaded the file but it has been saved as "=_UTF-8_Q_test=5Fcase=2Eodb_=.txt" and when I open it, I only see Question marks
Comment 11 Jan-Marek Glogowski 2018-10-30 20:21:24 UTC
My guess is other people use it in documents to refer to a DB entry.
I don't know if spaces would be allowed but even if not this probably used to be an error, so making that a valid different case instead won't help much.

What happens if you escape the dots as \.? No idea if this is supported in these fields, but it would probably be a way to implement it and won't break documents. Or is there some other common escaping variant used in LO?
Comment 12 Jan-Marek Glogowski 2018-10-30 20:23:09 UTC
Or even ODF hase some specs, how this field should behave and be encoded or escaped.
Comment 13 Xisco Faulí 2018-10-30 20:25:12 UTC
Nothing happens if dot is scaped ( \. ). OTOH, spaces are accepted