WebDevStudios / CollabPress

74 stars 35 forks source link

Single Task: Due Date and Priority not shown. #92

Open ruudvh opened 11 years ago

ruudvh commented 11 years ago

When viewing a single task, the due date and priority is not shown.

The issue is here: (Around line 15 in content-single-task.php)

<?php if ( $due_date = cp_get_the_task_due_date() ) {
  echo '<div>' . __( 'Due date: ', 'collabpress' ) . $due_date . '</div>';
} ?>
<?php if ( ( $priority = cp_get_the_task_priority() ) != 'None' ) {
   echo '<div>' . __( 'Priority: ', 'collabpress' ) . $priority . '</div>';
} ?>

The function cp_get_the_task_due_date() and cp_get_the_tak_priority() seem not to be functioning properly.

To fix it, replace it with the following:

<?php if ( $due_date = cp_get_task_due_date_mysql( cp_get_the_task_ID() ) ) {
   echo '<div>' . __( 'Due date: ', 'collabpress' ) . $due_date . '</div>';
} ?>
<?php if ( ( $priority = cp_get_task_priority( cp_get_the_task_ID() ) ) != 'None' ) {
   echo '<div>' . __( 'Priority: ', 'collabpress' ) . $priority . '</div>';
} ?>

The only thing it does is skip a step. The functions cp_get_the_task_due_date() and cp_get_the_tak_priority() actually call the functions cp_get_task_due_date_mysql() and cp_get_task_priority().

Please note this is a quick fix, and might not be the ideal solution.