Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception rendering dashboard panel with latest tasks when custom int field configured
Closed, ResolvedPublic

Description

  1. PHP 8.2.13, Phorge at 99ee9357eff29f450526607cabec9ec557cfdec3
  2. Have an older Phabricator database on that system which has set up a Dashboard panel defined by "Search For: Maniphest Tasks" and "Query: Open Tasks" on http://phorge.localhost/dashboard/view/1/ AND has a "int" type custom field defined under http://phorge.localhost/config/edit/maniphest.custom-field-definitions/ , for example:
{
  "points.final": {
    "name": "Final Story Points",
    "type": "int",
    "description": "Retrospectively determined story points",
    "caption": "Actual story points determined retrospectively",
    "search": true,
    "copy": false,
    "fulltext": false,
    "view": false,
    "edit": true
  }
}
  1. Install most recent Phorge on that machine and configure it to access that database (and run ./bin/storage upgrade if required)
  2. Try to access the Phorge frontpage.
[2023-12-05 03:17:00] ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php:56]
[2023-12-05 03:17:00] ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php:56]
arcanist(head=master, ref.master=16a412b10802), phorge(head=ExceptionCustomTextFieldPanel, ref.master=99ee9357eff2, ref.ExceptionCustomTextFieldPanel=e0fff7433a37)
  #0 PhabricatorStandardCustomFieldInt::applyApplicationSearchConstraintToQuery(ManiphestTaskSearchEngine, ManiphestTaskQuery, NULL) called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomField.php:794]
  #1 PhabricatorCustomField::applyApplicationSearchConstraintToQuery(ManiphestTaskSearchEngine, ManiphestTaskQuery, NULL) called at [<phorge>/src/infrastructure/customfield/engineextension/PhabricatorCustomFieldSearchEngineExtension.php:48]
  #2 PhabricatorCustomFieldSearchEngineExtension::applyConstraintsToQuery(ManiphestTask, ManiphestTaskQuery, PhabricatorSavedQuery, array) called at [<phorge>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:177]
  #3 PhabricatorApplicationSearchEngine::buildQueryFromSavedQuery(PhabricatorSavedQuery) called at [<phorge>/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php:87]
arcanist(head=master, ref.master=16a412b10802), phorge(head=ExceptionCustomTextFieldPanel, ref.master=99ee9357eff2, ref.ExceptionCustomTextFieldPanel=e0fff7433a37)
  #4 PhabricatorDashboardQueryPanelType::renderPanelContent(PhabricatorUser, PhabricatorDashboardPanel, ManiphestTaskSearchEngine) called at [<phorge>/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php:172]
  #0 PhabricatorStandardCustomFieldInt::applyApplicationSearchConstraintToQuery(ManiphestTaskSearchEngine, ManiphestTaskQuery, NULL) called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomField.php:794]
  #5 PhabricatorDashboardPanelRenderingEngine::renderNormalPanel() called at [<phorge>/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php:156]
  #1 PhabricatorCustomField::applyApplicationSearchConstraintToQuery(ManiphestTaskSearchEngine, ManiphestTaskQuery, NULL) called at [<phorge>/src/infrastructure/customfield/engineextension/PhabricatorCustomFieldSearchEngineExtension.php:48]
  #6 PhabricatorDashboardPanelRenderingEngine::renderPanel() called at [<phorge>/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelRenderController.php:55]
  #2 PhabricatorCustomFieldSearchEngineExtension::applyConstraintsToQuery(ManiphestTask, ManiphestTaskQuery, PhabricatorSavedQuery, array) called at [<phorge>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:177]
  #7 PhabricatorDashboardPanelRenderController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #8 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #3 PhabricatorApplicationSearchEngine::buildQueryFromSavedQuery(PhabricatorSavedQuery) called at [<phorge>/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php:87]
  #9 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
  #4 PhabricatorDashboardQueryPanelType::renderPanelContent(PhabricatorUser, PhabricatorDashboardPanel, ManiphestTaskSearchEngine) called at [<phorge>/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php:172]
  #5 PhabricatorDashboardPanelRenderingEngine::renderNormalPanel() called at [<phorge>/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php:156]
  #6 PhabricatorDashboardPanelRenderingEngine::renderPanel() called at [<phorge>/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelRenderController.php:55]
  #7 PhabricatorDashboardPanelRenderController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #8 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #9 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]