Replies: 1 comment 2 replies
-
|
Maybe Looking at the code, indeed
whereas modify case notes:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Context
I have
taskwarrior2.6.2, andtasklib2.5.1-2 installed withpacman. I also have many hooks modifying or checking the validity of the added or modified task, they all work fine.Since I am trying to implement some feature loosely resembling sub tasks, I need to 'cascade' changes made to "parent tasks" onto "children tasks".
Problem
I tried to reduce everything to the minimum to understand the errors I was getting, it turns out what works with
on-addhooks do not inon-modifyhooks. I cannot find any mention of that as a limitation in the docs. Maybe I missed something, in which case, sorry about that.Question
Can I modify tasks in the taskwarrior database from
on-modifyhooks ? And, if yes, how ?Steps to reproduce
Everything below is done with a 'minimal' config generated by
taskwarrior, and no other hooks in place than the one being tested.on-add Hook
Works as expected:
on-modify hook
Same hook as above expecting the same results:
No error is thrown, but no effects on the database:
Additional observations
Modifying the
on-modifyhook so the initial command filtering does not return any matching tasks throws an error.Other attempts
Loop
Looping through tasks using
tasklibproduces exactly the same results astw.execute_command. It also works fine from anon-addhook.subprocess produces interesting results
Trying to run the
taskcommand using the pythonsubprocessmodule produces a taskwarrior as if it was modifying the tasks, but produces no effects on the database from anon-modifyhook. Again, it works as expected from anon-addhook.Output from the
on-modifyhook:Beta Was this translation helpful? Give feedback.
All reactions