fix: correct variable naming and syntax errors in webhook actions #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Base information
Symptom (bug) / Objective (enhancement)
src/Core/Notification/Action/_ActionWebhook.php, the code referenced$this->m_aWebrequestErrorsinstead of the correct$this->aRequestErrors, causing runtime errors.case WebRequestSender::ENUM_SEND_STATE_ERROR;(semicolon instead of colon).tests/php-unit-tests/_ActionWebhookTest.php, unused imports (Exception,ReflectionException) were present.Reproduction procedure (bug)
With module version x.y.z
With PHP x.y.z
Trigger a webhook action that results in an error (e.g., invalid callback signature).
Observe PHP notices about undefined property or syntax errors in logs.
-->
On iTop 3.x.x
With module version 1.x.x
With PHP 7.4+ or 8.x
Trigger a webhook action that should log errors (e.g., misconfigured callback).
See PHP notice: "Undefined property: ...m_aWebrequestErrors"
See parse error if the switch case is hit.
Cause (bug)
$this->aRequestErrorsProposed solution (bug and enhancement)
_ActionWebhook.php_ActionWebhookTest.phpChecklist before requesting a review
Checklist of things to do before PR is ready to merge