When hooks get called in the request class (runPreHooks, runRenderHooks etc), the sumbitVar and hook names are passed as $customProperties to the loadMultiple method of the Hook class. The implementation of loadMultiple method passes the $customProperties as $errors to the load method. Secondly the $errors of the loadMultiple method are never forwarded to the load method.
$customProperties in loadMultiple method should be passed as $customProperties to the load method. And $errors in loadMultiple method should be forwarded to the load method.
Implementation in loadMultiple method should be as followed:
Bug report
Summary
When hooks get called in the request class (runPreHooks, runRenderHooks etc), the sumbitVar and hook names are passed as $customProperties to the loadMultiple method of the Hook class. The implementation of loadMultiple method passes the $customProperties as $errors to the load method. Secondly the $errors of the loadMultiple method are never forwarded to the load method.
Step to reproduce
See implementation of loadMultiple method: https://github.com/Sterc/FormIt/blob/de51f81a0b7e5c90aee3889d6a5a912e4c407a6d/core/components/formit/src/FormIt/Hook.php#L106
and the interface of load method: https://github.com/Sterc/FormIt/blob/de51f81a0b7e5c90aee3889d6a5a912e4c407a6d/core/components/formit/src/FormIt/Hook.php#L127
Observed behavior
Variables are mixed in the loadMultiple method
Expected behavior
$customProperties in loadMultiple method should be passed as $customProperties to the load method. And $errors in loadMultiple method should be forwarded to the load method.
Implementation in loadMultiple method should be as followed:
$success = $this->load($hook, $this->fields, $errors, $customProperties);
Environment
N/A