Page MenuHomePhorge

PHP 8.1 "strlen(null)" exception setting story points on a task
Closed, ResolvedPublic

Description

(I took these steps to reach this code after greping the codebase for strlen. Seems like a better long-run approach than playing whack-a-mole.)

  1. PHP 8.2.6; Phorge at 2df7ea13a3877250354556f08f40e26ccc727144
  2. As an admin user, go to http://phorge.localhost/config/settings/all/
  3. Select maniphest.points to go to http://phorge.localhost/config/edit/maniphest.points/
  4. Paste database value { "enabled": true, "label": "Story Points", "action": "Change Story Points" }
  5. Select Save Config Entry button
  6. Go to http://phorge.localhost/maniphest/task/edit/form/default/
  7. Enter whatever as task title
  8. Select Create New Task button
[2023-05-12 21:13:35] EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=renderDashboardTabPanelContent, ref.master=d47289622650, ref.renderDashboardTabPanelContent=d47289622650), phorge(head=changePoints, ref.master=2df7ea13a387, ref.changePoints=2df7ea13a387)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/maniphest/xaction/ManiphestTaskPointsTransaction.php:101]
  #1 <#2> ManiphestTaskPointsTransaction::getValueForPoints(NULL) called at [<phorge>/src/applications/maniphest/xaction/ManiphestTaskPointsTransaction.php:9]
  #2 <#2> ManiphestTaskPointsTransaction::generateOldValue(ManiphestTask) called at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:500]
  #3 <#2> PhabricatorApplicationTransactionEditor::getTransactionOldValue(ManiphestTask, ManiphestTransaction) called at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:387]
  #4 <#2> PhabricatorApplicationTransactionEditor::adjustTransactionValues(ManiphestTask, ManiphestTransaction) called at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1273]
  #5 <#2> PhabricatorApplicationTransactionEditor::applyTransactions(ManiphestTask, array) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:1149]
  #6 <#2> PhabricatorEditEngine::buildEditResponse(ManiphestTask) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:1000]
  #7 <#2> PhabricatorEditEngine::buildResponse() called at [<phorge>/src/applications/maniphest/controller/ManiphestTaskEditController.php:12]
  #8 <#2> ManiphestTaskEditController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #9 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #10 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #11 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #12 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #13 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix that exception; get the task correctly created.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.