Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task maneger is broken #4505

Closed
davidbeijinho opened this issue Dec 7, 2023 · 2 comments
Closed

task maneger is broken #4505

davidbeijinho opened this issue Dec 7, 2023 · 2 comments

Comments

@davidbeijinho
Copy link

davidbeijinho commented Dec 7, 2023

Trilium Version

0.61.0-beta

What operating system are you using?

Other Linux

What is your setup?

Server access only

Operating System Version

6.1.65-1 - x86_64 GNU/Linux

Description

since version 0.61.0-beta to current one (0.62.4) the task manager example is broken, when you set a new due date is not added to the journal day

I tested and the last working version for this feature is 0.60-latest

Error logs

[Script ynOQATCPFfiq] ERROR: Execution of script "attribute changed" (ynOQATCPFfiq) failed with error: Load of script note "attribute changed" (ynOQATCPFfiq) failed with: Cannot move note to deleted parent note 'null'

No response

@clq
Copy link

clq commented Dec 11, 2023

I found the problem: under "attribute changed" the script is attempting to set Tasks to done even though they aren't done, causing the script to fail before non-Done tasks are moved under the right Day-note.

Search your notes for:

const doneTargetNoteId = isTaskDone ? api.getDayNote(doneDate).noteId : null;

You should see the lines:

const doneTargetNoteId = isTaskDone ?  api.getDayNote(doneDate).noteId : null;
api.setNoteToParent(note.noteId, 'DONE', doneTargetNoteId);

Wrap these in an if statement, so you end up with:

if (isTaskDone) {
const doneTargetNoteId = isTaskDone ?  api.getDayNote(doneDate).noteId : null;
api.setNoteToParent(note.noteId, 'DONE', doneTargetNoteId);
}

I can't promise you that this is the best fix, but it works for me.

Edit: Speculating, I expect there was a change between versions in the API on how setting a parent note to null works from ignoring and continuing, to throwing.

@zadam
Copy link
Owner

zadam commented Dec 11, 2023

Hi, thanks for reporting this bug.

@clq was correct, API got broken which then caused this bug.

@zadam zadam closed this as completed Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants