Bug 154560 - Data validity bugs in custom formulas and drop-down lists.
Summary: Data validity bugs in custom formulas and drop-down lists.
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.5.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks:
 
Reported: 2023-04-02 11:20 UTC by Konstantin
Modified: 2023-07-15 00:21 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
file with errors (19.60 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2023-04-02 11:24 UTC, Konstantin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin 2023-04-02 11:20:17 UTC
Description:
Two errors found.
1. Data validation by formula does not work when opening a file. Validation starts working only after editing the data validation formula. FILEOPEN EDITING
2. When the file is saved, the values disappear from the data validation list. FILESAVE

Steps to Reproduce:
Bug first. FILEOPEN
1. Open a file.
2. Change the value in column "A" in cells "A3", "A4", etc. (these cells with data validation by the formula).
3. LibreOffice displays "Login not available" message. Validation failed. It's error.
4. Fix this error: select cell 'A3' or 'A4' or etc. Click tab 'Data' -> 'Validity...' -> 'Ok'. Entry is available in this cell! Now data validation works correctly!

Bug two. FILESAVE
1. Check the values in the data validation list for cells "B3", "B4", etc.
2. Change any other cell in the file. Save and close the file.
3. Open the file again and check the values in the data validation list for cells "B3", "B4", etc. The bottom half of the values are not in the data validation list.

The file in which the error occurs.
https://disk.yandex.ru/i/YcsnRgiFjdkbMQ

Actual Results:
Bug first. Formula data validation started working in cells 'A3', 'A4' etc.
Bug two. Missing values from dropdown data validation list in cells 'B3', 'B4' etc.

Expected Results:
Bug first. The cell data validation formula should work as soon as the file is opened.
Bug two. Values from the data validation list should not disappear after saving.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
The file in which the error occurs.
https://disk.yandex.ru/i/YcsnRgiFjdkbMQ
Comment 1 Konstantin 2023-04-02 11:24:54 UTC
Created attachment 186407 [details]
file with errors
Comment 2 Buovjaga 2023-04-04 11:35:02 UTC
We take one issue per report, so let's focus on the first one for this report.

I tried editing A3 to have cat6, but got an error dialog:

Названия уже созданных тематик указаны на втором листе этого файла All_Subjects. Придумайте новое имя для своего творения.

Please explain how to test with your file.

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the information.
Comment 3 ady 2023-04-04 20:07:05 UTC
(In reply to Buovjaga from comment #2)

I'm not the reporter, but I do understand how to reproduce the reported behavior.

> I tried editing A3 to have cat6, but got an error dialog:
> 
> Названия уже созданных тематик указаны на втором листе этого файла
> All_Subjects. Придумайте новое имя для своего творения.
> 
> Please explain how to test with your file.

...Then while in A3 go to Data Validity and click OK on the dialog. Now a new value (e.g. "a") is accepted, whereas before the OK, it was not.

I'm not sure this is really a bug, because there is a kind of circular reference: the condition for the validity check includes the value of the cell where the validity is being checked.

Adding the formula to check the validity in a different cell and then having the original validity check that new cell might work around the "circular reference".

Whether the behavior is acceptable, or it is a bug, IDK.
Comment 4 najevi 2023-07-15 00:21:25 UTC
The problem appears to be a matter of file format used. I did not notice until saving my experimental edits of the test case under a different filename but ... the test case file submitted is saved in xlsx format ... not ods format!

Once the (unedited) test case file is saved in ods format, then closed and reopened: ... all data validity formula used in column A behave just as you would expect!

SO .. I'm not sure any of the following helps but it is included for thoroughness...


There is definitely something strange happening with the formula drawn in from an xlsx format file and used for the validity rule in column A but it is _not_ a problem with any circular reference.

The "circular reference" is legitimate because the validity rule has the type: 
Allow: Custom 
which necessarily takes a 
Formula
and that formula cannot possibly produce an input value-dependent result if the input value is not referred to within the formula. ... n'est-ce pas?

Just about any edit of the formula causes the formula to behave as you would expect. i.e. an input that is not found in the list (from column A on the second sheet) is allowed but an input that matches any value already in that list is disallowed. 

Indeed selecting any cell in Parameters column A and then opening Data Validity then cutting and pasting the _very_same_formula_ then saving that validity rule causes the desired behaviour.

... ah hah! file format of test case is xlxs not ods !!