View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0031892 | mantisbt | plug-ins | public | 2023-01-10 10:22 | 2023-01-25 14:02 |
Reporter | sederther | Assigned To | dregad | ||
Priority | low | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Product Version | 2.25.5 | ||||
Summary | 0031892: Error occurs when adding bugnote through API in PHP8 | ||||
Description | Hello, I received the following error when calling <pre><code> <pre><code>[Tue Jan 10 15:08:16.309432 2023] [proxy_fcgi:error] [pid 2366:tid 140321925056256] [client 10.0.2.2:57660] AH01071: Got error 'PHP message: Slim Application Error:\nType: Error\nMessage: Unknown named parameter $files\nFile: /projects/mantisbt/core/event_api.php\nLine: 206\nTrace: #0 /projects/mantisbt/core/event_api.php(232): event_callback()\n#1 /projects/mantisbt/core/event_api.php(164): event_type_execute()\n#2 /projects/mantisbt/core/commands/IssueNoteAddCommand.php(281): event_signal()\n#3 /projects/mantisbt/core/commands/Command.php(137): IssueNoteAddCommand->process()\n#4 /projects/mantisbt/api/rest/restcore/issues_rest.php(266): Command->execute()\n#5 [internal function]: rest_issue_note_add()\n#6 /projects/mantisbt/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func()\n#7 /projects/mantisbt/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->invoke()\n#8 /projects/mantisbt/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->invoke()\n#9 /projects/mantisbt/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack()\n#10 /projects/mantisbt/ven...' | ||||
Steps To Reproduce | Its happening when there is a plugin that implements hook EVENT_BUGNOTE_ADD and the function called does not have parameter named $files. | ||||
Additional Information | I have submitted this pull request in github | ||||
Tags | No tags attached. | ||||
This is the root cause, actually... Your Plugin's event hook's signature must match the parameters as called by the event signal. In this case the documentation clearly states that there are 3 parameters, and the 3rd one's key must be IMO the appropriate fix here is to update your plugin, not to change MantisBT's core (event API). |
|
I understand. I will fix the plugin and close the pull request. thank you! |
|
Thanks for your understanding |
|