Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts: htdocs/core/class/commonobject.class.php
This commit is contained in:
commit
8e4c89673a
@ -5843,8 +5843,15 @@ abstract class CommonObject
|
|||||||
$attributeLabel = $extrafields->attributes[$this->table_element]['label'][$attributeKey];
|
$attributeLabel = $extrafields->attributes[$this->table_element]['label'][$attributeKey];
|
||||||
$attributeParam = $extrafields->attributes[$this->table_element]['param'][$attributeKey];
|
$attributeParam = $extrafields->attributes[$this->table_element]['param'][$attributeKey];
|
||||||
$attributeRequired = $extrafields->attributes[$this->table_element]['required'][$attributeKey];
|
$attributeRequired = $extrafields->attributes[$this->table_element]['required'][$attributeKey];
|
||||||
|
$attributeUnique = $extrafields->attributes[$this->table_element]['unique'][$attributeKey];
|
||||||
$attrfieldcomputed = $extrafields->attributes[$this->table_element]['computed'][$attributeKey];
|
$attrfieldcomputed = $extrafields->attributes[$this->table_element]['computed'][$attributeKey];
|
||||||
|
|
||||||
|
// If we clone, we have to clean unique extrafields to prevent duplicates.
|
||||||
|
// This behaviour can be prevented by external code by changing $this->context['createfromclone'] value in createFrom hook
|
||||||
|
if (! empty($this->context['createfromclone']) && $this->context['createfromclone'] == 'createfromclone' && ! empty($attributeUnique)) {
|
||||||
|
$new_array_options[$key] = null;
|
||||||
|
}
|
||||||
|
|
||||||
// Similar code than into insertExtraFields
|
// Similar code than into insertExtraFields
|
||||||
if ($attributeRequired) {
|
if ($attributeRequired) {
|
||||||
$mandatorypb = false;
|
$mandatorypb = false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user