diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 145c1742077..94a51ef3d01 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -490,7 +490,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// Planned workload
print '
| '.$langs->trans("PlannedWorkload").' | ';
- print $form->select_duration('planned_workload', $planned_workload?$planned_workload : $object->planned_workload,0,'text');
+ print $form->select_duration('planned_workload', $planned_workload?$planned_workload : 0, 0, 'text');
print ' |
';
// Progress
@@ -506,11 +506,12 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// Other options
$parameters=array();
- $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
+ $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$taskstatic,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
+
if (empty($reshook) && ! empty($extrafields_task->attribute_label))
{
- print $object->showOptionals($extrafields_task,'edit');
+ print $taskstatic->showOptionals($extrafields_task,'edit'); // Do not use $object here that is object of project
}
print '';