Fix error message with old usage of childtables

This commit is contained in:
Laurent Destailleur
2018-06-26 18:26:44 +02:00
parent ff6ffa4738
commit ac758e02a9

View File

@@ -3322,7 +3322,14 @@ abstract class CommonObject
$langs->load("errors");
//print 'Found into table '.$table.', type '.$langs->transnoentitiesnoconv($elementname).', haschild='.$haschild;
$haschild += $obj->nb;
$this->errors[]=$langs->trans("ErrorRecordHasAtLeastOneChildOfType", $langs->transnoentitiesnoconv($elementname));
if (is_numeric($elementname)) // old usage
{
$this->errors[]=$langs->trans("ErrorRecordHasAtLeastOneChildOfType", $table);
}
else // new usage: $elementname=Translation key
{
$this->errors[]=$langs->trans("ErrorRecordHasAtLeastOneChildOfType", $langs->transnoentitiesnoconv($elementname));
}
break; // We found at least one, we stop here
}
}