Bug 158072 - Fails to apply AutoFilter or Standard Filter in Mail Merge dialog after it was applied once successfully (Writer+Calc)
Summary: Fails to apply AutoFilter or Standard Filter in Mail Merge dialog after it wa...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.2.0 target:7.6.4
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Mail-Merge Data-Filter
  Show dependency treegraph
 
Reported: 2023-11-05 13:20 UTC by lal
Modified: 2023-12-01 13:06 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lal 2023-11-05 13:20:41 UTC
Description:
Premise:
I have a Writer document with data from a Calc spreadsheet linked through database fields (using mail merge function). When I want to print, LO correctly asks "Your document contains address database fields. Do you want to print a form?". I confirm YES and the proper Mail Merge Dialogue comes up. 

(a) However, when I try to apply Standard Filter, "field name" drop-down only states "empty" and nothing else can be selected (all other parts greyed out). 

(b) If I instead try to apply AutoFilter, LO states "Error setting the filter criteria. The column is not searchable!". I can then select MORE or OK (buttons). As I select MORE I get "Error details" with two errors: "Error setting the filter criteria" and "SQL Status: 01000 / Error code: 1000 / The column is not searchable!" (here I can only click OK)

It has been tested and repeated multiple times with the same result. The two files are stored in the same folder and are standard .ODT and .ODS. I have no issues with any other of the functions of mail merge (i.e. I have different database fields selected and shown where and when they should, so links seem to work)

Steps to Reproduce:
1.Create a Calc ODS with three columns and 3 rows:
----------------
COL1---COL2-COL3
Adam---1----X
Bertil-2----Y
Ceasar-2----Z
----------------

2. Create a Writer ODT and insert field - more fields... - mail merge fields (select the ODS) - Sheet 1 - COL1 (repeat for COL2 and COL3)
3. Select Print in Writer
4. Select YES as response to "Your document contains address database fields. Do you want to print a form?"
5. Try to Apply filter (=fails)

Actual Results:
(a) If applying Standard Filter, "field name" drop-down only states "empty" and nothing else can be selected (all other parts greyed out). 

(b) If applying AutoFilter, LO states "Error setting the filter criteria. The column is not searchable!"

Expected Results:
Able to select filter conditions to print (as mail merge) only those database records that match the criteria of the filter conditions.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: threaded
Comment 1 Stéphane Guillou (stragu) 2023-11-22 13:57:53 UTC
Thank you for the report!

(In reply to lal from comment #0)
> (a) If applying Standard Filter, "field name" drop-down only states "empty"
> and nothing else can be selected (all other parts greyed out). 
> (b) If applying AutoFilter, LO states "Error setting the filter criteria.
> The column is not searchable!"
Reproduced both (a) and (b), but _only after successfully applying a filter once_.

1. Have ODT linked to ODS as data source
2. Ctrl + P > Yes (to "print a form letter")
3. Apply AutoFilter on the table: works
4. Click "Cancel"
5. Bring the dialog up again: Ctrl + P > Yes. See that the filter is still active.

Result: now, filtering fails as described by OP. Close and reopen the file, filter can be used once more.
Same with an XLSX data source.

Version: 7.6.3.1 (X86_64) / LibreOffice Community
Build ID: c4af5b1259bceea6e979e6fe2435dbee7a5a87c2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: baecfd21797310bb15ab98ca3962445d99e397db
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US

No repro in 7.5:

Version: 7.5.8.2 (X86_64) / LibreOffice Community
Build ID: f718d63693263970429a68f568db6046aaa9df01
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

-> regression.
Calc: threaded
Comment 2 Stéphane Guillou (stragu) 2023-11-22 20:34:27 UTC
Bibisected with comment 1 steps and linux-64-7.6 repo to first bad build commit [72f0cb3c4944426945266c1dab48e09e9768c0c0] which points to:

commit 66b0bc55854ba13b92b6c39b95f3f2d4ef76bf20
author	Noel Grandin 	Fri Mar 10 10:35:33 2023 +0200
committer	Noel Grandin 	Fri Mar 10 09:50:16 2023 +0000
simplify initialisation in *DatabaseMetaData
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148594

Noel, can you please have a look?
Comment 3 Commit Notification 2023-11-23 11:07:21 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f23ee916466bd6e0d328a4e541e104445c8ecb0a

tdf#158072 Fails to apply AutoFilter in Mail Merge dialog

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2023-11-23 17:09:06 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/8e81f2462962e0e4ff6b4546d5956df61d6f4d74

tdf#158072 Fails to apply AutoFilter in Mail Merge dialog

It will be available in 7.6.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Stéphane Guillou (stragu) 2023-12-01 13:06:54 UTC
Fix verified in:

Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 619500d6919c227e734b119481a4b334972e0b7b
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thank you lal and Noel!