TW-1580: "modified" attribute not updated
- Make all local modifications update the "modified" attribute. - As per design, the user cannot overwrite this attribute; neither can hooks.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
- TW-1578 Bash tab completion problems on first run
|
||||
(thanks to Renato Alves and Ptolemarch).
|
||||
- TW-1580 "modified" attribute no longer updated (thanks to David Patrick).
|
||||
- Setting 'bulk' to zero is interpreted as infinity, which means there is no
|
||||
amount of changes that is considered dangerous (thanks to Tomas Babej).
|
||||
|
||||
|
||||
@@ -598,7 +598,7 @@ void TDB2::update (
|
||||
const std::string& uuid,
|
||||
Task& task,
|
||||
const bool add_to_backlog,
|
||||
const bool addition)
|
||||
const bool addition /* = false */)
|
||||
{
|
||||
// Validate to add metadata.
|
||||
task.validate (false);
|
||||
@@ -607,6 +607,13 @@ void TDB2::update (
|
||||
Task original;
|
||||
if (not addition && get (task.get ("uuid"), original))
|
||||
{
|
||||
if (add_to_backlog)
|
||||
{
|
||||
// All locally modified tasks are timestamped, implicitly overwriting any
|
||||
// changes the user or hooks tried to apply to the "modified" attribute.
|
||||
task.setAsNow ("modified");
|
||||
}
|
||||
|
||||
// Update the task, wherever it is.
|
||||
if (!pending.modify_task (task))
|
||||
completed.modify_task (task);
|
||||
|
||||
Reference in New Issue
Block a user