Bug 431468 - Unable to copy and paste tasks
Summary: Unable to copy and paste tasks
Status: REPORTED
Alias: None
Product: korganizer
Classification: Applications
Component: todoview (show other bugs)
Version: 5.16.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-11 22:38 UTC by Isaac Wismer
Modified: 2021-01-12 20:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Calendar selection dialog (33.43 KB, image/png)
2021-01-12 18:25 UTC, gjditchfield
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Isaac Wismer 2021-01-11 22:38:59 UTC
SUMMARY
I have some tasks that are repetitive, and so I want to be able to copy and paste them, but when I try to paste them, I get the error: "Error while trying to create calendar item. Error was: Invalid parent collection"

STEPS TO REPRODUCE
1. Create task
2. Copy Task
3. Paste task

OBSERVED RESULT
An error message pops up and the task is not copied

EXPECTED RESULT
A duplicate task is created.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
I have a nextcloud calendar synced, with 3 different calendars, plus a couple read only ICal calendars. The task is in one of the nextcloud calendars.
The same error also occurs when I use the "Copy To" command in the context menu,
Comment 1 gjditchfield 2021-01-12 02:49:03 UTC
Which view or views did you try this in?

When you paste, does a dialog appear that gives you a choice of calendars to paste into?

Do you get errors if you copy events?

If you run korganizer from the command line and reproduce the error, does it print any messages?
Comment 2 Isaac Wismer 2021-01-12 02:56:42 UTC
(In reply to gjditchfield from comment #1)
> Which view or views did you try this in?

The ToDo list view

> 
> When you paste, does a dialog appear that gives you a choice of calendars to
> paste into?

No

> 
> Do you get errors if you copy events?

Yes, the same error

> 
> If you run korganizer from the command line and reproduce the error, does it
> print any messages?

"Invalid parent collection"
org.kde.pim.korganizer: Incidence not added, job reported error:  "Invalid parent collection"
Comment 3 Isaac Wismer 2021-01-12 02:58:25 UTC
(In reply to gjditchfield from comment #1)
> Which view or views did you try this in?

I also tried copying events in the month and agenda (week) views

> 
> When you paste, does a dialog appear that gives you a choice of calendars to
> paste into?
> 
> Do you get errors if you copy events?
> 
> If you run korganizer from the command line and reproduce the error, does it
> print any messages?
Comment 4 gjditchfield 2021-01-12 03:43:53 UTC
Which view or views did you try this in?

When you paste, does a dialog appear that gives you a choice of calendars to paste into?

Do you get errors if you copy events?

If you run korganizer from the command line and reproduce the error, does it print any messages?
Comment 5 gjditchfield 2021-01-12 03:44:43 UTC
Ooops, sorry.
Comment 6 gjditchfield 2021-01-12 04:02:14 UTC
Copy/paste works for me.  I hate it when that happens.

I suspect that your Akonadi database is damaged.  This might help:
- close Kontact, KOrganizer, and the rest of the PIM suite.
- on the command line, run "akonadictl stop;  akonadictl fsck;  akonadictl vacuum"

Removing and re-adding the Nextcloud calendar might also work around the problem.
Comment 7 Isaac Wismer 2021-01-12 13:18:35 UTC
(In reply to gjditchfield from comment #6)
> Copy/paste works for me.  I hate it when that happens.
:( darn, definitely makes it hard to diagnose.

> I suspect that your Akonadi database is damaged.  This might help:
> - close Kontact, KOrganizer, and the rest of the PIM suite.
> - on the command line, run "akonadictl stop;  akonadictl fsck;  akonadictl
> vacuum"
I tried stopping akonadi first, but then it said it wouldn't run fsck or vacuum, so then I restarted it, and it ran both. Didn't fix the bug though.

> Removing and re-adding the Nextcloud calendar might also work around the
> problem.
Did this, and still can't copy/paste. Same behaviour as before.
Comment 8 gjditchfield 2021-01-12 18:25:15 UTC
Created attachment 134789 [details]
Calendar selection dialog
Comment 9 gjditchfield 2021-01-12 18:26:38 UTC
Since you have more than one calendar, you probably should be asked to pick the one to paste into.  See the attachment for the dialog I get.

Look in Settings ยป Configure KOrganizer..., in the General section's Save tab.  If it says that new items should be added to the standard calendar, switch to "Be asked which calendar to use" and see if that helps.
Comment 10 Isaac Wismer 2021-01-12 18:55:21 UTC
It was set to "Be added to the standard calendar", and when I switched it to "Be asked which calendar to use" it was fixed! It now prompts me with what calendar I want to add it to. I guess there was an issue with the default calendar, and it didn't know what calendar to add it to.

Thank you very much for your help!
Comment 11 gjditchfield 2021-01-12 20:11:33 UTC
There's still a bug here: as I understand the code, if the standard calendar is unwritable, you should be asked to pick a different one.

You mentioned that you have read-only ICal calendars.  Is the standard calendar one of them?  Is it marked read-only in the file system?  If you look at its Calendar Properties dialog (in its context menu) is the "Read only" box checked?
Comment 12 Isaac Wismer 2021-01-12 20:22:32 UTC
I have 5 calendars:
Nextcloud - Personal
Nextcloud - Class
Nextcloud - Assignments
Nextcloud - Contacts Birthdays (Read Only)
ICal - Holidays (Read Only, and for some reason also gives me an extra calendar "akonadi_ical_resource_11", which seems to be an empty calendar)

I think the birthday calendar is set to my default (not sure why). If I set the default to my personal calendar, then change the save settings back to add to default calendar, the bug is gone. So it looks like the bug was related to it not asking for an alternate calendar when the original calendar is not writeable.