Bug 132042 - TEMPLATE MANAGER: Errors when deleting a category in templates
Summary: TEMPLATE MANAGER: Errors when deleting a category in templates
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on:
Blocks: Template-Manager
  Show dependency treegraph
 
Reported: 2020-04-10 20:59 UTC by BogdanB
Modified: 2021-05-27 04:42 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
video of the bug (1.33 MB, video/mp4)
2020-04-14 16:50 UTC, BogdanB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BogdanB 2020-04-10 20:59:56 UTC
Description:
Open a new writer document and go to File - Templates - Manage Templates.
Go to setting symbol and add a new category named A. Go to that symbol again and create B category.
Now try to delete category B. You get an error: You can not delete this category. 
After this you can delete this category and other.

Also I notice the A category was deleted sometimes. Please repeat the steps form above for some times.

Steps to Reproduce:
1. See description
2.
3.

Actual Results:
error when trying to delete a category

Expected Results:
deletig a category with no error


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.0.0.0.alpha0+
Build ID: 0dd48d1a9a716456ff1ebe67e19881ad2f56939b
CPU threads: 4; OS: Linux 5.3; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-03-31_14:07:24
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 Dieter 2020-04-13 14:18:38 UTC
No problem to delete B category (it isn't possible, if category is selected in category filter dropdown list). But I also noticed, that category A is part of the category filter list, but not part of the list of categories, I can select for deletion. But that's not part of the reported bug

Version: 7.0.0.0.alpha0+ (x64)
Build ID: 962b415edb47187737a5f05c4ff3f6724a19c564
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-GB
Calc: threaded
Comment 2 BogdanB 2020-04-14 16:50:55 UTC
Created attachment 159560 [details]
video of the bug

Please see the video.

The last item created if deleted creates an error, but instead is deleted the first item created.

See in video with 11 and 22 items. I was deleting 22, but after the error occur with 22, the 11 itme is not there anymore....
Comment 3 Dieter 2020-04-14 17:31:56 UTC
Thank for the video. Now the bug is more clear to me. I could follow all the steps and I can confirm it with

Version: 7.0.0.0.alpha0+ (x64)
Build ID: 962b415edb47187737a5f05c4ff3f6724a19c564
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-GB
Calc: threaded

So it's not only the problem, that an error message pops up, but also that the wrong category seems to be deleted.
Comment 4 sdc.blanco 2020-12-14 03:52:07 UTC
@Bogdan -- what happens if before you start to delete, you go to the Settings button again, and choose the "Refresh" command.  (or alternatively, close and reopen the Template Manager).

When I do either one, then I do not encounter any problems.

When I follow your procedure, then I also get the "warning" message about not being able to delete (but I was also watching the directory where the category is stored, and I could see that category was, in fact, deleted -- even though it continued to appear in the Template Manager.

These observations are suggestive of likely cause of your problem (as well as a workaround). 

My tests done with 7.2.0.0.alpha0+
Comment 5 BogdanB 2020-12-14 06:31:50 UTC
I agree with you, the problem is refresh, but I do not consider to be ok to create something than to refresh that and so on. Autorefresh should exist there at some point.

tested with
Version: 7.0.4.1
Build ID: e3cebc55238632eae061a3da668963d484a71147
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 6 VertD 2021-03-30 02:43:52 UTC
I submitted a patch https://gerrit.libreoffice.org/c/core/+/113331
Comment 7 BogdanB 2021-04-08 04:41:11 UTC
I don't know how to test a patch before being included in master.
Comment 8 BogdanB 2021-05-18 10:29:13 UTC
I tested the master on Windows. No update on this patch?

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 6c8ca02c5935a800cff70f3c173319b454b63c41
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: ro-RO (ro_RO); UI: en-US
Calc: threaded
Comment 9 Dieter 2021-05-18 10:36:10 UTC
(In reply to BogdanB from comment #8)
> I tested the master on Windows. No update on this patch?

VertD, do you still work on this? (same question to you in Gerrit)
cc: devoptmsoi@gmx.com
Comment 10 VertD 2021-05-20 22:32:33 UTC
looks good to me.
Comment 11 BogdanB 2021-05-21 03:43:51 UTC
VertD, I retested. It's the same, on Linux and Windows.
Please take a look at the video from comment 2.


Retested.
Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: b238522ca121ca8f863fe4d3394ade088a65ad01
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: en-US (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 12 Commit Notification 2021-05-21 07:54:52 UTC
Vert D committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9431984f8d39a4d7fb9428138ecc6971c212c122

tdf#132042 fix nItem id when creating region

It will be available in 7.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 13 BogdanB 2021-05-27 04:42:04 UTC
Vert D, I marked this bug as resolved.
Comment 14 BogdanB 2021-05-27 04:42:43 UTC
Also I verified, everything is now ok in 
Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: 42d2b2d55a27f11153ea1713737d93540a19211d
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded