Author Topic: Error when viewing a task with no due date.  (Read 5986 times)

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Error when viewing a task with no due date.
« on: February 04, 2009, 11:05:03 am »
When you try to view a task with no due date you get an error 500. You can fix it by changing line 16 on 'application/views/task/task_list.php' from:
Code: [Select]
<?php if ($task_list->getDueDate()->getYear() > DateTimeValueLib::now()->getYear()) { ?>
  <div class="dueDate"><span><?php echo lang('due date'?>: </span><?php echo format_date($task_list->getDueDate(), null0?></div>
<?php } else { ?>
  <div class="dueDate"><span><?php echo lang('due date'?>: </span><?php echo format_descriptive_date($task_list->getDueDate(), 0?></div>
to:
Code: [Select]
<?php if ($task_list->getDueDate() instanceof DateTimeValue) { ?>
<?php if ($task_list->getDueDate()->getYear() > DateTimeValueLib::now()->getYear()) { ?>
  <div class="dueDate"><span><?php echo lang('due date'?>: </span><?php echo format_date($task_list->getDueDate(), null0?></div>
<?php } else { ?>
  <div class="dueDate"><span><?php echo lang('due date'?>: </span><?php echo format_descriptive_date($task_list->getDueDate(), 0?></div>
<?php // if ?>
<?php // if ?>

This will be fixed on 1.2 RC2.
« Last Edit: February 05, 2009, 09:09:06 am by ignacio »