Bug 152110 - LanguageTool extension (version <6.0) prevents adding words to dictionaries via context menu with 2+ dictionaries present
Summary: LanguageTool extension (version <6.0) prevents adding words to dictionaries v...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL: https://github.com/languagetool-org/l...
Whiteboard: target:24.8.0 target:24.2.3 target:7.6.7
Keywords: bibisected, bisected, regression
: 151508 160237 (view as bug list)
Depends on:
Blocks: Spell-Checking
  Show dependency treegraph
 
Reported: 2022-11-18 15:51 UTC by Marcin Segit
Modified: 2024-04-03 06:46 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
recording (4.27 MB, video/webm)
2024-03-29 21:10 UTC, Caolán McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Segit 2022-11-18 15:51:52 UTC
Description:
After installation of the LanguageTool extension it is not possible to add words to a dictionary from RMB context menu if 2 or more dictionaries are present and active in LO.

Steps to Reproduce:
1. Install LangageTool and restart LO
2. Create additional dictionary to have 2 or more
3. Type random word/letters and try adding them to any of the dictionaries from RMB context menu

Actual Results:
The word is not added to a dictionary.

Expected Results:
A word is added to a dictionary.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.4.2.3 (x64) / LibreOffice Community
Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL
Comment 1 Stéphane Guillou (stragu) 2022-11-23 20:15:58 UTC Comment hidden (obsolete)
Comment 2 Marcin Segit 2022-11-23 21:18:47 UTC
(In reply to Stéphane Guillou (stragu) from comment #1)
> I tested with up to two extra dictionaries on top of the "standard.dic" one.
> Are your steps different in any way?

The bug is related to LanguageTool extension (v5.9.1 and lower) so you have to install the extension, not to activate the remote solution: https://extensions.libreoffice.org/en/extensions/show/languagetool.

LT team is aware of the issue (reported in Oct). In their opinion this is LO bug and they came up with a workaround for future LT 6.0: https://github.com/languagetool-org/languagetool/issues/7298.

With the remote solution I'm experiencing yet another issue that words are added to any dictionary but are not recognized afterwards but this is something for another bug report.
Comment 3 QA Administrators 2022-11-24 03:43:18 UTC Comment hidden (obsolete)
Comment 4 Dieter 2022-11-26 11:49:54 UTC
What's the difference to your bug 151508?
=> NEEDINFO
Comment 5 Marcin Segit 2022-11-26 16:58:32 UTC
Ah, sorry. 151508 can be closed as a flawed duplicate of sorts. Back then I didn't realize that the issue is connected to having multiple dictionaries (and there is no way to edit the initial entry). Please close 151508 and keep 152110. Thanks!
Comment 6 QA Administrators 2022-11-27 03:39:13 UTC Comment hidden (obsolete)
Comment 7 Dieter 2022-11-27 12:51:27 UTC
*** Bug 151508 has been marked as a duplicate of this bug. ***
Comment 8 Stéphane Guillou (stragu) 2022-11-28 08:48:07 UTC
Mert, any opinion on this one?
Comment 9 Marcin Segit 2023-01-19 10:24:10 UTC
LanguageTool workaround introduced in version 6.0 works so far. The drawback is that now all dictionaries are displayed under "Add to Dictionary" context menu, that is other languages than the one selected for current document/text and additional dictionaries that were not visible previously.
Comment 10 Stéphane Guillou (stragu) 2023-01-20 14:41:52 UTC
Looking at two comments from the LT extension bug tracker[1][2]:

> "I think that the problem started with 7.4.0 release where RMB context menus for synonyms and adding to a dictionary were missing. The menus are back now but RMB add to dictionary does not work when there are 2+ dictionaries present and the LanguageTool is installed." [...]

With the reply:

> Yes, it's a LO bug. It occurs when more than one dictionary is used. [...]

I tested with version 5.9.1 of the LT extension.
- In LO version 7.3.7.2, adding a word to standard.dic does make the spellcheck underling disappear.
- In LO version 7.4.4.2, adding a word to standard.dic fails to include it. Adding it via the spellcheck dialog does work.

So it does seem the issue is in LO, but I can't reproduce without the extension installed. I tried adding two custom dictionaries but I couldn't reproduce. What is particular about this extension that it reveals the buggy behaviour?

[1]: https://github.com/languagetool-org/languagetool/issues/7298#issuecomment-1320472306
[2]: https://github.com/languagetool-org/languagetool/issues/7298#issuecomment-1320874418

Versions:

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

Not repro in: Version: 7.4.4.2 / LibreOffice Community
Build ID: 85569322deea74ec9134968a29af2df5663baa21
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 11 Marcin Segit 2024-02-12 20:56:33 UTC
I believe this one can be closed. The workaround works. It's not very elegant as the other dictionaries are still visible but at least it works fine.
Comment 12 Stéphane Guillou (stragu) 2024-02-20 07:09:18 UTC
Thanks Marcin.

It is indeed resolved in LT 6.0 and above, but I'm wondering if this might become a problem further down the line...

If it helps for anyone wanting to look into it, this is the LT workaround by Fred Kruse: https://github.com/languagetool-org/languagetool/commit/bdf0dd47177dc877d489b661296898b25ba83d8c

I've looked into when it started, using the linux-64-releases bibisect repository and the LT extension version 5.9.1: libreoffice-7.4.0.0.alpha1 is the first one affected.

I'll try to get to a precise commit next.
Comment 13 Stéphane Guillou (stragu) 2024-02-20 14:26:35 UTC
Bibisected with linux-64-7.4 repo, English Dictionary 2024.02.01 and LT 5.9.1 to first bad build [90bf995886394ca0da189b5b61a35659ada696e7] which points to:

commit afa35742a4633db31b6d6c72cf45741506e9edfb
author	Caolán McNamara 	Sat Dec 11 21:09:39 2021 +0000
committer	Caolán McNamara 	Sun Dec 12 13:35:00 2021 +0100
prefer more css::awt::XPopupMenu api
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126692

Caolán, same culprit as for bug 157258. Can you please have a look?
Comment 14 Caolán McNamara 2024-03-29 21:10:53 UTC
Created attachment 193396 [details]
recording

I'm a bit confused, I went back to language tool 5.6 and installed it in todays (gtk3+linux) trunk version. And did as seen in this recording. Is the problem visible here and I'm missing it, or do I need to do something different?
Comment 15 Caolán McNamara 2024-03-31 10:04:02 UTC
given that bug #157258 was bisected to the same commit, perhaps the new fix for that also fixes this?
Comment 16 Stéphane Guillou (stragu) 2024-04-02 09:01:57 UTC
Tested effect of patch 7f7a7cf0eca793a9efb8456f96ccfece07f6f9d9 with linux-64-bibisect repo (build [99f6480f5b2229c203d2d8de9f502f674da6105e]), with LT 5.9.1 and English dictionaries 20240401, it is indeed that commit that also fixes this.

Thanks Caolán!
Comment 17 Stéphane Guillou (stragu) 2024-04-03 06:46:33 UTC
*** Bug 160237 has been marked as a duplicate of this bug. ***