- 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:
Paul Beckingham 2010-02-05 18:34:12 -05:00
parent 73d6e05c0e
commit 5567b04277
3 changed files with 17 additions and 2 deletions

View file

@ -77,6 +77,9 @@
epoch numbers instead of dates (thanks to Cory Donnelly).
+ Fixed bug #369 which prevented the config command from setting quoted or
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 ------------------------------

View file

@ -1300,7 +1300,8 @@ int handleModify (std::string &outs)
!task->has ("recur"))
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.get ("due") == "")
throw std::string ("You cannot remove the due date from a recurring task.");

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 7;
use Test::More tests => 9;
# Create the rc file.
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:};
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.
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');