Skip to content

Commit

Permalink
Merge pull request #33105 from BenjaminFlr/fixMB
Browse files Browse the repository at this point in the history
FIX(modulebuilder): validate after creation
  • Loading branch information
eldy authored Feb 18, 2025
2 parents 65cd535 + cea44d5 commit 0d10942
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions htdocs/modulebuilder/template/class/myobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,16 @@ public function __construct(DoliDB $db)
*/
public function create(User $user, $notrigger = 0)
{
$resultcreate = $this->createCommon($user, $notrigger);
$result = $this->createCommon($user, $notrigger);

// uncomment lines below if you want to validate object after creation
// if ($result > 0) {
// $this->fetch($this->id); // needed to retrieve some fields (ie date_creation for masked ref)
// $resultcreate = $this->validate($user, $notrigger);
// $resultupdate = $this->validate($user, $notrigger);
// if ($resultupdate < 0) { return $resultupdate; }
// }

return $resultcreate;
return $result;
}

/**
Expand Down

0 comments on commit 0d10942

Please sign in to comment.