When the 'by' column is hidden in the project timespent list, the form does
not emit a userid_line input. The updateline handler then read
GETPOSTINT('userid_line') as 0 and overwrote timespent_fk_user. The downstream
'in_array($object->timespent_fk_user, $childids)' guard with fk_user=0
blocked the update and the user saw a confusing 'Field User is required' for
the unchanged user assignment.
Only overwrite timespent_fk_user when the form actually posted userid_line,
mirroring the date column fix from #34511.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
This commit is contained in:
parent
3424914d8b
commit
4cacecdbdc
1 changed files with 8 additions and 2 deletions
|
|
@ -313,7 +313,10 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
|
|||
$object->timespent_date = $timespent_date;
|
||||
$object->timespent_withhour = 0;
|
||||
}
|
||||
$object->timespent_fk_user = GETPOSTINT("userid_line");
|
||||
// If column "by" is hidden, no userid_line is posted; keep the existing fk_user instead of resetting it to 0.
|
||||
if (GETPOSTISSET("userid_line")) {
|
||||
$object->timespent_fk_user = GETPOSTINT("userid_line");
|
||||
}
|
||||
$object->timespent_fk_product = GETPOSTINT("fk_product");
|
||||
$object->timespent_invoiceid = GETPOSTINT("invoiceid");
|
||||
$object->timespent_invoicelineid = GETPOSTINT("invoicelineid");
|
||||
|
|
@ -348,7 +351,10 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
|
|||
$object->timespent_withhour = 0;
|
||||
}
|
||||
|
||||
$object->timespent_fk_user = GETPOSTINT("userid_line");
|
||||
// If column "by" is hidden, no userid_line is posted; keep the existing fk_user instead of resetting it to 0.
|
||||
if (GETPOSTISSET("userid_line")) {
|
||||
$object->timespent_fk_user = GETPOSTINT("userid_line");
|
||||
}
|
||||
$object->timespent_fk_product = GETPOSTINT("fk_product");
|
||||
$object->timespent_invoiceid = GETPOSTINT("invoiceid");
|
||||
$object->timespent_invoicelineid = GETPOSTINT("invoicelineid");
|
||||
|
|
|
|||
Loading…
Reference in a new issue