Apache OpenOffice (AOO) Bugzilla – Issue 120418
No update in conditional fields when exchanging databases
Last modified: 2012-08-02 18:44:59 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.
Created attachment 78787 [details] Short evidence of the bug
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 #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.
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) 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
(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
(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]
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.
(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.
Created attachment 78829 [details] Screen shot: True and False in the spreadsheet are not boolean
Created attachment 78830 [details] Screen shot: TRUE and FALSE in the spreadsheet are BOOLEAN
Created attachment 78831 [details] Screen shot: Data Source Browser (F4) displays boolean values as check boxes
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.
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"
(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.
(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.
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.