Issue 120418 - No update in conditional fields when exchanging databases
Summary: No update in conditional fields when exchanging databases
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: programming (show other issues)
Version: 3.4.0
Hardware: PC Windows 7
: P3 Normal with 2 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-31 06:58 UTC by Alessandro Balsamo
Modified: 2012-08-02 18:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Short evidence of the bug (24.36 KB, application/vnd.oasis.opendocument.text)
2012-07-31 07:32 UTC, Alessandro Balsamo
no flags Details
Zip file with documents to test (31.50 KB, application/zip)
2012-08-01 00:16 UTC, Ariel Constenla-Haile
no flags Details
Source file to play with (181.76 KB, application/x-zip-compressed)
2012-08-02 15:05 UTC, Alessandro Balsamo
no flags Details
Screen shot: True and False in the spreadsheet are not boolean (8.39 KB, image/png)
2012-08-02 16:21 UTC, Ariel Constenla-Haile
no flags Details
Screen shot: TRUE and FALSE in the spreadsheet are BOOLEAN (8.44 KB, image/png)
2012-08-02 16:22 UTC, Ariel Constenla-Haile
no flags Details
Screen shot: Data Source Browser (F4) displays boolean values as check boxes (87.58 KB, image/png)
2012-08-02 16:23 UTC, Ariel Constenla-Haile
no flags Details
Source code to play with - improved (34.33 KB, application/x-zip-compressed)
2012-08-02 16:56 UTC, Alessandro Balsamo
no flags Details
Screen shot: Edit Fields dialog after exchanging data source (21.86 KB, image/png)
2012-08-02 17:30 UTC, Ariel Constenla-Haile
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Alessandro Balsamo 2012-07-31 06:58:19 UTC
The bug occurs when a document contains a conditional field with reference to an external database. In particular, when the reference is either in the "True" or in the "False" sub-field, or in both.
When using the command "Exchange database..." (note: I am using the Italian version, where the command name is "Scambia database..." in the menu "Modifica"), correct exchange occurs for the condition test - if any - but not for the "True" and/or "False" subfields, which remain obsolete.
This is particularly painful for complex documents with many fields: apparently all works fine, all fileds are updated correctly, apart from the one(s) mentioned. This may not be obvious to detect, and real risk exisits of incorrect mailmerge.
Comment 1 Alessandro Balsamo 2012-07-31 07:32:21 UTC
Created attachment 78787 [details]
Short evidence of the bug
Comment 2 Ariel Constenla-Haile 2012-08-01 00:16:50 UTC
Created attachment 78792 [details]
Zip file with documents to test

Content of the zip file:

db1.ods = spreadsheet document to use a data source
db2.ods = spreadsheet document to use a data source

bugdoc.odt = text document with conditional text, condition based on data source fields

merge_db1.odt = document result of merging to a file, with data source db1.ods
merge_db2.odt = document result of merging to a file, with data source db2.ods
Comment 3 Ariel Constenla-Haile 2012-08-01 00:23:38 UTC
(In reply to comment #0)
> The bug occurs when a document contains a conditional field with reference
> to an external database. In particular, when the reference is either in the
> "True" or in the "False" sub-field, or in both.

In the Proof.odt you have embedded two spreadsheet document.
In these spreadsheets, the condition column does not have boolean values.
Their values is likely stored as string literal
'True
'False

Did this ever work?
I could not reproduce the bug with the test in attachment 78792 [details] on OO 3.4.1, rev. 1366353

Please take a look at the test document, just in case I didn't understand the problem.
Comment 4 Alessandro Balsamo 2012-08-02 12:54:12 UTC
In attachment 78787 [details], there is no link to any database in the true/false subfields, just in the condition subfield. The "Exchange dotabases" command works properly on the condition, but doses not on the true/false subfields.
This is why I put just either True or False in the condition column in my db1 and db2 sample databases, and some explanatory values in the other columns I intended to focus on.
The databases you reproduced in attachment 78792 [details] are the same as I used in my short document.
> Created attachment 78792 [details]
> Zip file with documents to test
> 
> Content of the zip file:
> 
> db1.ods = spreadsheet document to use a data source
> db2.ods = spreadsheet document to use a data source
> 
> bugdoc.odt = text document with conditional text, condition based on data
> source fields
> 
> merge_db1.odt = document result of merging to a file, with data source
> db1.ods
> merge_db2.odt = document result of merging to a file, with data source
> db2.ods
Comment 5 Alessandro Balsamo 2012-08-02 12:58:18 UTC
(In reply to comment #4)
Sorry I made a copy/paste mistake inteh address of the first attachment mentioned in my comment: plese swap this to comment 4:
In attachment 78792 [details], there is no link to any database in the true/false subfields, just in the condition subfield. The "Exchange dotabases" command works properly on the condition, but doses not on the true/false subfields.
This is why I put just either True or False in the condition column in my db1 and db2 sample databases, and some explanatory values in the other columns I intended to focus on.
The databases you reproduced in attachment 78792 [details] are the same as I used in my short document.
> In attachment 78787 [details], there is no link to any database in the
> true/false subfields, just in the condition subfield. The "Exchange
> dotabases" command works properly on the condition, but doses not on the
> true/false subfields.
> This is why I put just either True or False in the condition column in my
> db1 and db2 sample databases, and some explanatory values in the other
> columns I intended to focus on.
> The databases you reproduced in attachment 78792 [details] are the same as I
> used in my short document.
> > Created attachment 78792 [details]
> > Zip file with documents to test
> > 
> > Content of the zip file:
> > 
> > db1.ods = spreadsheet document to use a data source
> > db2.ods = spreadsheet document to use a data source
> > 
> > bugdoc.odt = text document with conditional text, condition based on data
> > source fields
> > 
> > merge_db1.odt = document result of merging to a file, with data source
> > db1.ods
> > merge_db2.odt = document result of merging to a file, with data source
> > db2.ods

(In reply to comment #4)
> In attachment 78787 [details], there is no link to any database in the
> true/false subfields, just in the condition subfield. The "Exchange
> dotabases" command works properly on the condition, but doses not on the
> true/false subfields.
> This is why I put just either True or False in the condition column in my
> db1 and db2 sample databases, and some explanatory values in the other
> columns I intended to focus on.
> The databases you reproduced in attachment 78792 [details] are the same as I
> used in my short document.
> > Created attachment 78792 [details]
> > Zip file with documents to test
> > 
> > Content of the zip file:
> > 
> > db1.ods = spreadsheet document to use a data source
> > db2.ods = spreadsheet document to use a data source
> > 
> > bugdoc.odt = text document with conditional text, condition based on data
> > source fields
> > 
> > merge_db1.odt = document result of merging to a file, with data source
> > db1.ods
> > merge_db2.odt = document result of merging to a file, with data source
> > db2.ods
Comment 6 Ariel Constenla-Haile 2012-08-02 13:02:09 UTC
(In reply to comment #5)
> In attachment 78792 [details], there is no link to any database in the
> true/false subfields,

yes, there is. It somehow gets broken when the database it references no longer exists. Please try to recreate the fields.
And the two spreadsheets I use are not like the ones you embedded: in your embedded spreadsheets I see 'True and 'False, two strings, not TRUE and FALSE
Comment 7 Ariel Constenla-Haile 2012-08-02 13:09:48 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > In attachment 78792 [details], there is no link to any database in the
> > true/false subfields,
> 
> yes, there is. It somehow gets broken when the database it references no
> longer exists.

Those two spreadsheets in the attachment are not registered as data sources in your office installation, that's why the link to the data source gets broken. You have to edit the fields, and browse to the spreadsheet, select it, and this way it get registered as data source in your office .

> Please try to recreate the fields.
> And the two spreadsheets I use are not like the ones you embedded: in your
> embedded spreadsheets I see 'True and 'False, two strings, not TRUE and FALSE

Steps:

- Edit the <True-Value> fields
- In the edit dialog, you have to add the database file, press the "Browse..." button and browse to one of the spreadsheets in the attachment 78792 [details]
Comment 8 Alessandro Balsamo 2012-08-02 15:05:21 UTC
Created attachment 78828 [details]
Source file to play with

(In reply to comment #7)
Apparently db1 and db2 are registered, as you can see in the screen snapshot (in the zip file).
Please, try yourself: in the .zip file I included all three source files (text + 2 db's) you can play with yourself. The point is that when one exchanges databases from e.g. db1 to db2, the references in the True and False subfields do not get updated to the new database.
Comment 9 Ariel Constenla-Haile 2012-08-02 16:20:13 UTC
(In reply to comment #8)
> Apparently db1 and db2 are registered, as you can see in the screen snapshot
> (in the zip file).
> Please, try yourself: in the .zip file I included all three source files
> (text + 2 db's) you can play with yourself. The point is that when one
> exchanges databases from e.g. db1 to db2, the references in the True and
> False subfields do not get updated to the new database.

The issue here is that True and False are strings in your spreadsheets, NOT boolean values.

If they where boolean, when display on the Data Source Browser (F4), in the column you see check boxes, instead of True and False.
Comment 10 Ariel Constenla-Haile 2012-08-02 16:21:37 UTC
Created attachment 78829 [details]
Screen shot: True and False in the spreadsheet are not boolean
Comment 11 Ariel Constenla-Haile 2012-08-02 16:22:36 UTC
Created attachment 78830 [details]
Screen shot: TRUE and FALSE in the spreadsheet are BOOLEAN
Comment 12 Ariel Constenla-Haile 2012-08-02 16:23:49 UTC
Created attachment 78831 [details]
Screen shot: Data Source Browser (F4) displays boolean values as check boxes
Comment 13 Alessandro Balsamo 2012-08-02 16:56:43 UTC
Created attachment 78832 [details]
Source code to play with - improved

Yes you are right: the supposedly boolean values are string in fact (this was due to my national version: I wanted to have the db's in English but the Italian version does not recognise the English strings "True" and "False".

HOwever, my issue is not there, rather located in the true (or positive) and false (negative) cluases of the conditional field (not in the condition field).

In the attached zip, the supposedly boolean fields were converted to boolean, and the result of two mailmerges were recorded, the first whit the original database db1 linked, and the second after the "Exchambe database" command.
All is just fine in mailmerge1. In mailmerge2 instead, all values resulting from the conditional field (second row of each page) are taken from db1 rather than from db2, as expected after the "Exchange database" command.
Comment 14 Ariel Constenla-Haile 2012-08-02 17:30:54 UTC
Created attachment 78833 [details]
Screen shot: Edit Fields dialog after exchanging data source

In the "Condition" the name of the data base is updated from db1 to db2, but in the "Then" and "Else" clauses, the name of the data source is still db1 after exchanging to db2

It tried with OOo 3.3.0 OOO330m20 (Build:9567) and it shows the same behavior: exchanging the data source only updates the "Condition", but not the "Then" nor the "Else"
Comment 15 Ariel Constenla-Haile 2012-08-02 17:38:58 UTC
(In reply to comment #14)
> I tried with OOo 3.3.0 OOO330m20 (Build:9567) and it shows the same
> behavior: exchanging the data source only updates the "Condition", but not
> the "Then" nor the "Else"

It does not work on 000320m18 (Build:9502)

@Alessandro: can you confirm this is the bug:

After exchanging the data source, only the data source reference in "Condition" is updated, but not in "Then" nor "Else" if they contain data source references too.

Do you recall if this ever worked on previous versions?

In any case, it's not a regression introduced in AOO 3.4.0.
Comment 16 Alessandro Balsamo 2012-08-02 18:36:38 UTC
(In reply to comment #15) 
> @Alessandro: can you confirm this is the bug:
> 
> After exchanging the data source, only the data source reference in
> "Condition" is updated, but not in "Then" nor "Else" if they contain data
> source references too.

Yes, I do confirm.

> Do you recall if this ever worked on previous versions?

Never worked in any previous version.
Comment 17 Ariel Constenla-Haile 2012-08-02 18:44:59 UTC
Confirmed
See attachment 78833 [details] and comment 14


BEFORE exchanging, db1.Sheet1 is the data source:

- "Condition"  [db1.Sheet1.ColumnA]
- "Then"       [db1.Sheet1.ColumnB]
- "Else"       [db1.Sheet1.ColumnC]

AFTER exchanging to db2.Sheet1:


- "Condition"  [db2.Sheet1.ColumnA]
- "Then"       [db1.Sheet1.ColumnB]
- "Else"       [db1.Sheet1.ColumnC]

Only the reference in "Condition" is updated.

Expected result: the references in "Then" and "Else" should be updated too.