After helping a user upgrade to FengOffice 1.6.1 from OpenGoo 1.5.3 the following error message was received after debugging was turned on in the config file:
Fatal error: Call to a member function getTimestamp() on a non-object in /usr/local/apache2/htdocs/pm/opengoo/application/helpers/calendar.php on line 105
This prevents the Overview tab from being displayed.
When clicking on the Calendar tab the following pop-up error is shown:
Error: og.eventSelected is not a function
Everything appears to be in good working order except the Calendar functions. We can disable the calendar module and the Overview tab will display properly.
The function this error refers to is:
function forwardRepDate(ProjectTask $task, $min_date) {
if ($task->isRepetitive()) {
if (($task->getRepeatBy() == 'start_date' && !$task->getStartDate() instanceof DateTimeValue) ||
($task->getRepeatBy() == 'due_date' && !$task->getDueDate() instanceof DateTimeValue)) {
return array('date' => $min_date, 'count' => 0); //This should not happen...
}
$date = new DateTimeValue($task->getRepeatBy() == 'start_date' ? $task->getStartDate()->getTimestamp() : $task->getDueDate()->getTimestamp());
$count = 0;
if($date->getTimestamp() >= $min_date->getTimestamp()) {
return array('date' => $date, 'count' => $count);
}
while ($date->getTimestamp() < $min_date->getTimestamp()) {
if ($task->getRepeatD() > 0) {
$date = $date->add('d', $task->getRepeatD());
} else if ($task->getRepeatM() > 0) {
$date = $date->add('M', $task->getRepeatM());
} else if ($task->getRepeatY() > 0) {
$date = $date->add('y', $task->getRepeatY());
}
$count++;
}
return array('date' => $date, 'count' => $count);
} else return array('date' => $min_date, 'count' => 0);
}
Hope that helps troubleshoot the issue.