Bug Fix - #370
- Task was preventing removal of due date from any task that had a due date, which is wrong. It should be any task with a recur: value and a due date (thanks to John Florian).
This commit is contained in:
@@ -77,6 +77,9 @@
|
|||||||
epoch numbers instead of dates (thanks to Cory Donnelly).
|
epoch numbers instead of dates (thanks to Cory Donnelly).
|
||||||
+ Fixed bug #369 which prevented the config command from setting quoted or
|
+ Fixed bug #369 which prevented the config command from setting quoted or
|
||||||
unquoted multi-word values (thanks to Richard Querin).
|
unquoted multi-word values (thanks to Richard Querin).
|
||||||
|
+ Fixed bug #370 which prevented the removal of a due date from a task,
|
||||||
|
mis-identifying the task as recurring just because it had a due date
|
||||||
|
(thanks to John Florian).
|
||||||
|
|
||||||
------ old releases ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -1300,7 +1300,8 @@ int handleModify (std::string &outs)
|
|||||||
!task->has ("recur"))
|
!task->has ("recur"))
|
||||||
throw std::string ("You cannot specify an until date for a non-recurring task.");
|
throw std::string ("You cannot specify an until date for a non-recurring task.");
|
||||||
|
|
||||||
if (task->has ("due") &&
|
if (task->has ("recur") &&
|
||||||
|
task->has ("due") &&
|
||||||
context.task.has ("due") &&
|
context.task.has ("due") &&
|
||||||
context.task.get ("due") == "")
|
context.task.get ("due") == "")
|
||||||
throw std::string ("You cannot remove the due date from a recurring task.");
|
throw std::string ("You cannot remove the due date from a recurring task.");
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 7;
|
use Test::More tests => 9;
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'bug.rc')
|
if (open my $fh, '>', 'bug.rc')
|
||||||
@@ -53,6 +53,17 @@ unlike ($output, qr/You cannot remove the recurrence from a recurring task./ms,
|
|||||||
$output = qx{../task rc:bug.rc 2 recur:};
|
$output = qx{../task rc:bug.rc 2 recur:};
|
||||||
like ($output, qr/You cannot remove the recurrence from a recurring task./ms, 'Recurrence removal error');
|
like ($output, qr/You cannot remove the recurrence from a recurring task./ms, 'Recurrence removal error');
|
||||||
|
|
||||||
|
# Prevent removal of the due date from a recurring task.
|
||||||
|
$output = qx{../task rc:bug.rc 2 due:};
|
||||||
|
like ($output, qr/You cannot remove the due date from a recurring task./ms, 'Cannot remove due date from a recurring task');
|
||||||
|
|
||||||
|
# Allow removal of the due date from a non-recurring task.
|
||||||
|
qx{../task rc:bug.rc add nonrecurring};
|
||||||
|
$output = qx{../task rc:bug.rc ls};
|
||||||
|
my ($id) = $output =~ /(\d+)\s+nonrecurring/;
|
||||||
|
$output = qx{../task rc:bug.rc $id due:};
|
||||||
|
unlike ($output, qr/You cannot remove the due date from a recurring task./ms, 'Can remove due date from a non-recurring task');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink 'pending.data';
|
unlink 'pending.data';
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
ok (!-r 'pending.data', 'Removed pending.data');
|
||||||
|
|||||||
Reference in New Issue
Block a user