Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions core/dbobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,12 +762,7 @@ public function SetIfNull($sAttCode, $value)
*/
public function CopyIfNull($sDestAttCode, $sSourceAttCode)
{
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sDestAttCode);
$oCurrentValue = $this->Get($sDestAttCode);
if ($oAttDef->IsNull($oCurrentValue))
{
return $this->Copy($sDestAttCode, $sSourceAttCode);
}
$this->SetIfNull($sDestAttCode, $this->Get($sSourceAttCode));
return true;
Copy link
Contributor Author

@favincen favincen Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to Combodo: Set() and Copy() do return true unconditionaly upon completion, but SetIfNul() do not return any value. Seems unconsistant to me.
So how do this new CopyIfNull() method should behave concerning returning value ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And should SetIfNull() be updated to return a boolean upon completion ?

}

Expand Down