Page MenuHomePhorge

LotusLinkManiphestCustomField.php:258, occurrences: 1
OpenPublic

Asked by TychoTa on Jul 2 2024, 12:21.

Details

PHP version: 8.2.20

Recorded items (sample):
LotusLinkManiphestCustomField.php:258, occurrences: 1

strlen(): Passing null to parameter #1 ($string) of type string is deprecated
arcanist(head=master, ref.master=21fbc806e4e1), phabricator-match-extensions(head=master, ref.master=4852496b8109), phorge(head=master, ref.master=9a44a81e797d)
#0 LotusLinkManiphestCustomField::applyApplicationSearchConstraintToQuery(ManiphestTaskSearchEngine, ManiphestTaskQuery, NULL) called at [<phorge>/src/infrastructure/customfield/engineextension/PhabricatorCustomFieldSearchEngineExtension.php:48]
#1 PhabricatorCustomFieldSearchEngineExtension::applyConstraintsToQuery(ManiphestTask, ManiphestTaskQuery, PhabricatorSavedQuery, array) called at [<phorge>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:178]
#2 PhabricatorApplicationSearchEngine::buildQueryFromSavedQuery(PhabricatorSavedQuery) called at [<phorge>/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php:93]
#3 PhabricatorDashboardQueryPanelType::renderPanelContent(PhabricatorUser, PhabricatorDashboardPanel, ManiphestTaskSearchEngine) called at [<phorge>/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php:172]
#4 PhabricatorDashboardPanelRenderingEngine::renderNormalPanel() called at [<phorge>/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php:156]
#5 PhabricatorDashboardPanelRenderingEngine::renderPanel() called at [<phorge>/src/applications/home/view/PHUIHomeView.php:149]
#6 PHUIHomeView::renderPanel(PhabricatorDashboardPanel) called at [<phorge>/src/applications/home/view/PHUIHomeView.php:111]
#7 PHUIHomeView::buildTasksPanel() called at [<phorge>/src/applications/home/view/PHUIHomeView.php:37]
#8 PHUIHomeView::getTagContent() called at [<phorge>/src/view/AphrontTagView.php:101]
#9 AphrontTagView::render() called at [<phorge>/src/view/AphrontView.php:222]
#10 AphrontView::producePhutilSafeHTML() called at [<phorge>/src/infrastructure/markup/render.php:115]
#11 phutil_escape_html(PHUIHomeView) called at [<phorge>/src/infrastructure/markup/render.php:139]
#12 phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:171]
#13 phutil_implode_html(string, array) called at [<phorge>/src/view/page/PhabricatorBarePageView.php:58]
#14 PhabricatorBarePageView::willRenderPage() called at [<phorge>/src/view/page/PhabricatorStandardPageView.php:217]
#15 PhabricatorStandardPageView::willRenderPage() called at [<phorge>/src/view/page/AphrontPageView.php:46]
#16 AphrontPageView::render() called at [<phorge>/src/view/page/PhabricatorStandardPageView.php:919]
#17 PhabricatorStandardPageView::produceAphrontResponse() called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:722]
#18 AphrontApplicationConfiguration::produceResponse(AphrontRequest, PhabricatorStandardPageView) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:299]
#19 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
#20 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Answers

avivey
Updated 107 Days Ago

Hi @TychoTa!

Thanks for reporting!

Looks like this is in an extension code phabricator-match-extensions - not something we manage here. Looks like it's this one: https://github.com/Supermarches-Match/phabricator-match-extensions (the commit hash matches).

valerio.bozzolan
Updated 107 Days Ago

Thanks again and I agree with avivey. In particular your issue is probably located here:

https://github.com/Supermarches-Match/phabricator-match-extensions/blob/4852496b810954fb65c858f709705d46f67415ed/src/customfields/LotusLinkManiphestCustomField.php#L258

That project should probably do this general replacement:

-if (strlen($value)) {
+if ($value !== null && strlen($value)) {

Here we have a nice document called "Check for non-empty string" with multiple approaches, to fix your extension correctly:

https://we.phorge.it/book/flavor/article/php_pitfalls/

New Answer