Skip to content

Commit

Permalink
Evarisk#1756 [Hook] fix: fatal typage formObjectOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Mar 7, 2024
1 parent a3c2e94 commit a023c83
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions class/actions_digiquali.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,12 @@ public function printCommonFooter($parameters)
/**
* Overloading the formObjectOptions function : replacing the parent's function with the one below
*
* @param array $parameters Hook metadata (context, etc...)
* @param object $object Object
* @return void
* @param array $parameters Hook metadatas (context, etc...)
* @param object|null $object Current object
* @return int 0 < on error, 0 on success, 1 to replace standard code
*/
public function formObjectOptions(array $parameters, object $object) {
public function formObjectOptions(array $parameters, ?object $object): int
{
if (strpos($parameters['context'], 'productlotcard') !== false) {
$objectData = ['type' => $object->element, 'id' => $object->id];

Expand All @@ -257,6 +258,8 @@ public function formObjectOptions(array $parameters, object $object) {
$object->updateExtrafield('control_history_link');
}
}

return 0; // or return 1 to replace standard code
}

/**
Expand Down

0 comments on commit a023c83

Please sign in to comment.