Bug 152037 - Data validation error when entering correct text length in XLSX file
Summary: Data validation error when entering correct text length in XLSX file
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Czeber László Ádám (NISZ)
URL:
Whiteboard: target:7.6.0 target:7.5.5
Keywords:
Depends on:
Blocks: Cell-Validity
  Show dependency treegraph
 
Reported: 2022-11-14 10:18 UTC by gontzalpujana
Modified: 2023-05-31 08:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Shows the formula in libreoffice (9.66 KB, image/png)
2022-11-14 10:19 UTC, gontzalpujana
Details
OOXML formula as seen in Google Docs (32.29 KB, image/jpeg)
2022-11-14 10:20 UTC, gontzalpujana
Details
Test file with sensitive info obfuscated (9.44 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2022-11-14 10:35 UTC, gontzalpujana
Details
New text file with validation issues (20.27 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2022-11-14 11:27 UTC, gontzalpujana
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gontzalpujana 2022-11-14 10:18:29 UTC
Description:
A cell with the formula =EQ(LEN(C2);(9)) is returning an error when entering a 9 character string into it.

It gets translated to Text Length equal 9 in LO, which should be correct for the validation, but doesn't validate the text correctly.

Steps to Reproduce:
1.Open the unmodified document
2.Enter a 9 character string into the cell

Actual Results:
Returns an error explaining we must enter 9 characters

Expected Results:
The cell string should be validated as correct


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.4.2.3 / LibreOffice Community
Build ID: 40(Build:3)
CPU threads: 12; OS: Linux 6.0; UI render: default; VCL: kf5 (cairo+xcb)
Locale: eu-ES (eu_ES.UTF-8); UI: es-ES
7.4.2-2
Calc: threaded
Comment 1 gontzalpujana 2022-11-14 10:19:19 UTC
Created attachment 183581 [details]
Shows the formula in libreoffice
Comment 2 gontzalpujana 2022-11-14 10:20:02 UTC
Created attachment 183582 [details]
OOXML formula as seen in Google Docs
Comment 3 gontzalpujana 2022-11-14 10:32:43 UTC
The nonworking validation appears like this in the XML file

<dataValidation allowBlank="true" error="dni / nie incorrecto&#10;debe tener 9 caracteres" errorStyle="stop" errorTitle="Error con DNI - NIE" operator="equal" showDropDown="false" showErrorMessage="true" showInputMessage="true" sqref="C2" type="textLength">
      <formula1>9</formula1>
      <formula2>0</formula2>
</dataValidation>
Comment 4 gontzalpujana 2022-11-14 10:35:01 UTC
Created attachment 183584 [details]
Test file with sensitive info obfuscated
Comment 5 Eike Rathke 2022-11-14 10:46:39 UTC
I don't see a problem with the sample document. Entering a text with length 9, for example 'abcdefghi', in C2 is accepted, any other length is rejected with the error box as specified by Validation. Same in C6.
Comment 6 gontzalpujana 2022-11-14 10:51:15 UTC
You're right, the sample file fixed itself, I must have done something while removing sensitive data. I'll upload a new file that has the bug. Sorry for the inconvenience.
Comment 7 gontzalpujana 2022-11-14 10:54:13 UTC
It seems that saving the file with LibreOffice and opening it again fixes the issue, but if no modification is made to the file the validation fails.
Comment 8 gontzalpujana 2022-11-14 11:27:43 UTC
Created attachment 183587 [details]
New text file with validation issues

Adding new test file. If you type 9 characters into the cell it returns an error, but if you paste them it doesn't validate the text.
Comment 9 Stéphane Guillou (stragu) 2022-11-14 13:50:26 UTC
I can reproduce with attachment 183587 [details]: entering 'abcdefghi' in cell C2 does throw the validation error. Saving and reopening fixes the issue.

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

Was already an issue in:

Version: 6.3.6.2
Build ID: 2196df99b074d8a661f4036fca8fa0cbfa33a497
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3; 
Locale: en-AU (en_AU.UTF-8); UI-Language: en-US
Calc: threaded
Comment 10 Stéphane Guillou (stragu) 2023-01-12 10:31:01 UTC
Also in 6.1.0.3:

Version: 6.1.0.3
Build ID: efb621ed25068d70781dc026f7e9c5187a4decd1
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group threaded

Also on Windows:

Version: 7.5.0.1 (X86_64) / LibreOffice Community
Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: threaded
Comment 11 Gabor Kelemen (allotropia) 2023-01-26 08:58:28 UTC
Quoting myself from: https://gerrit.libreoffice.org/c/core/+/146011 which fixed bug  150098:

Also this almost solves bug 152037 which is about something similar for XLSX.

* The validation set in the example file there fails when correct data (9 character text) is entered after opening the file.
* Going to Data - Validation and pressing OK without changing anything however makes it work, entering 9 characters of text is accepted.
Comment 12 Commit Notification 2023-05-30 13:38:29 UTC
Czeber László Ádám committed a patch related to this issue.
It has been pushed to "master":

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

tdf#152037 XLSX import: fix false alarm data validation error

It will be available in 7.6.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 13 Commit Notification 2023-05-30 17:26:04 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#152037: sc_uicalc: Add unittest

It will be available in 7.6.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 14 Commit Notification 2023-05-31 06:57:30 UTC
Czeber László Ádám committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#152037 XLSX import: fix false alarm data validation error

It will be available in 7.5.5.

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 15 NISZ LibreOffice Team 2023-05-31 08:28:29 UTC
VERIFIED IN:
Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 60e499147963e42ce783dffcf9c8d4aba8b5d475
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: CL threaded