View Issue Details

IDProjectCategoryView StatusLast Update
0034684mantisbtapi soappublic2024-09-28 11:28
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version2.26.4Fixed in Version2.26.4 
Summary0034684: SOAP API throwing deprecation warning on PHP 8.1
Description

Retrieving an issue via SOAP API (e.g. calling mc_project_get_issues) when one of the bugnotes has no text (BugnoteData->note === null), yields the following error

preg_replace(): Passing null to parameter 0000003 ($subject) of type array|string is deprecated

Steps To Reproduce

Run PHPUnit tests/soap suite with PHP >= 8.1

PHPUnit 9.6.20 by Sebastian Bergmann and contributors.

Runtime: PHP 8.1.29
Configuration: /Users/dregad/dev/mantisbt/mantis/phpunit.xml

..................EEE. 22 / 22 (100%)

Time: 00:05.685, Memory: 14.00 MB

There were 3 errors:

1) FilterTest::testGetAllProjectsIssues
SoapFault: Error Type: ,
Error Description: preg_replace(): Passing null to parameter 0000003 ($subject) of type array|string is deprecated

/Users/dregad/dev/mantisbt/mantis/tests/soap/FilterTest.php:614
/Users/dregad/dev/mantisbt/mantis/tests/soap/FilterTest.php:501

2) FilterTest::testGetAllProjectsIssueHeaders
SoapFault: Error Type: ,
Error Description: preg_replace(): Passing null to parameter 0000003 ($subject) of type array|string is deprecated

/Users/dregad/dev/mantisbt/mantis/tests/soap/FilterTest.php:644
/Users/dregad/dev/mantisbt/mantis/tests/soap/FilterTest.php:524

3) FilterTest::testFilterGetIssuesReturnsIssueMonitors
SoapFault: Error Type: ,
Error Description: preg_replace(): Passing null to parameter 0000003 ($subject) of type array|string is deprecated

/Users/dregad/dev/mantisbt/mantis/tests/soap/FilterTest.php:614
/Users/dregad/dev/mantisbt/mantis/tests/soap/FilterTest.php:556

ERRORS!
Tests: 22, Assertions: 64, Errors: 3.

Additional Information

This is probably not a normal usage scenario, as the tracker where this happened had data integrity issues (the bugnote_text record referenced in bugnote table was missing).

TagsPHP 8.1

Activities

Related Changesets

MantisBT: master-2.26 4ef5849d

2024-09-20 20:40

dregad


Details Diff
SOAP: Fix deprecation warning on PHP 8.1+

preg_replace(): Passing null to parameter 3 ($subject) of type
array|string is deprecated

Fixes 0034684
Affected Issues
0034684
mod - api/soap/mc_api.php Diff File