Page MenuHomePhorge

PHP 8.1 "strlen(null)" exceptions editing a form when custom field of type Date exists
Closed, ResolvedPublic

Description

  1. PHP 8.2.8; Phorge at bcfcd9acfc12fdf8ca3bf0e2c89651ba6d159b17
  2. As an admin, set http://phorge.localhost/config/edit/maniphest.custom-field-definitions/ to :
{
  "release.date": {
    "name": "Release Date",
    "edit": true,
    "view": true,
    "description": "Scheduled date for the release or deployment",
    "search": true,
    "fulltext": false,
    "type": "date",
    "copy": false
  }
}
  1. Select any of the forms listed on http://phorge.localhost/transactions/editengine/maniphest.task/ , e.g. go to http://phorge.localhost/transactions/editengine/maniphest.task/view/default/
[2023-08-14 19:48:55] EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=customOAuthUrlencodeNull, ref.master=788098096e11, ref.customOAuthUrlencodeNull=4f0f2043b7e9), phorge(head=master, ref.master=bcfcd9acfc12)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php:27]
  #1 <#2> PhabricatorStandardCustomFieldDate::getValueForStorage() called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomField.php:884]
  #2 <#2> PhabricatorCustomField::getNewValueForApplicationTransactions() called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomField.php:1177]
  #3 <#2> PhabricatorCustomField::newStandardEditField() called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php:492]
  #4 <#2> PhabricatorStandardCustomField::newStandardEditField() called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomField.php:1158]
  #5 <#2> PhabricatorCustomField::newStandardEditField() called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomField.php:1117]
  #6 <#2> PhabricatorCustomField::getEditEngineFields(ManiphestEditEngine) called at [<phorge>/src/infrastructure/customfield/engineextension/PhabricatorCustomFieldEditEngineExtension.php:52]
  #7 <#2> PhabricatorCustomFieldEditEngineExtension::buildCustomEditFields(ManiphestEditEngine, ManiphestTask) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:188]
  #8 <#2> PhabricatorEditEngine::buildEditFields(ManiphestTask) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:146]
  #9 <#2> PhabricatorEditEngine::getFieldsForConfig(PhabricatorEditEngineConfiguration) called at [<phorge>/src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:30]
  #10 <#2> PhabricatorEditEngineConfigurationDefaultsController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #11 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #12 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #13 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #14 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #15 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix exception, get next exception:

[2023-08-14 19:51:52] EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=customOAuthUrlencodeNull, ref.master=788098096e11, ref.customOAuthUrlencodeNull=4f0f2043b7e9), phorge(head=customFieldDate, ref.master=bcfcd9acfc12, ref.customFieldDate=bcfcd9acfc12)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php:35]
  #1 <#2> PhabricatorStandardCustomFieldDate::setValueFromStorage(NULL) called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomField.php:895]
  #2 <#2> PhabricatorCustomField::setValueFromApplicationTransactions(NULL) called at [<phorge>/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php:70]
  #3 <#2> PhabricatorCustomFieldEditField::buildControl() called at [<phorge>/src/applications/transactions/editfield/PhabricatorEditField.php:385]
  #4 <#2> PhabricatorEditField::renderControl() called at [<phorge>/src/applications/transactions/editfield/PhabricatorEditField.php:415]
  #5 <#2> PhabricatorEditField::appendToForm(AphrontFormView) called at [<phorge>/src/applications/transactions/controller/PhabricatorEditEngineConfigurationViewController.php:246]
  #6 <#2> PhabricatorEditEngineConfigurationViewController::buildFieldList(PhabricatorEditEngineConfiguration) called at [<phorge>/src/applications/transactions/controller/PhabricatorEditEngineConfigurationViewController.php:40]
  #7 <#2> PhabricatorEditEngineConfigurationViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #8 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #9 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #10 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #11 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #12 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix exception, get next exception:

[2023-08-14 19:53:15] EXCEPTION: (RuntimeException) ctype_digit(): Argument of type null will be interpreted as string in the future at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=customOAuthUrlencodeNull, ref.master=788098096e11, ref.customOAuthUrlencodeNull=4f0f2043b7e9), phorge(head=customFieldDate, ref.master=bcfcd9acfc12, ref.customFieldDate=bcfcd9acfc12)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #1 <#2> ctype_digit(NULL) called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php:77]
  #2 <#2> PhabricatorStandardCustomFieldDate::newDateControl() called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php:44]
  #3 <#2> PhabricatorStandardCustomFieldDate::renderEditControl(array) called at [<phorge>/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php:72]
  #4 <#2> PhabricatorCustomFieldEditField::buildControl() called at [<phorge>/src/applications/transactions/editfield/PhabricatorEditField.php:385]
  #5 <#2> PhabricatorEditField::renderControl() called at [<phorge>/src/applications/transactions/editfield/PhabricatorEditField.php:415]
  #6 <#2> PhabricatorEditField::appendToForm(AphrontFormView) called at [<phorge>/src/applications/transactions/controller/PhabricatorEditEngineConfigurationViewController.php:246]
  #7 <#2> PhabricatorEditEngineConfigurationViewController::buildFieldList(PhabricatorEditEngineConfiguration) called at [<phorge>/src/applications/transactions/controller/PhabricatorEditEngineConfigurationViewController.php:40]
  #8 <#2> PhabricatorEditEngineConfigurationViewController::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]
[2023-08-14 19:53:15] EXCEPTION: (PhutilAggregateException) Encountered a processing exception, then another exception when trying to build a response for the first exception.
    - RuntimeException: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated
    - RuntimeException: ctype_digit(): Argument of type null will be interpreted as string in the future at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:316]
arcanist(head=customOAuthUrlencodeNull, ref.master=788098096e11, ref.customOAuthUrlencodeNull=4f0f2043b7e9), phorge(head=customFieldDate, ref.master=bcfcd9acfc12, ref.customFieldDate=bcfcd9acfc12)
  #0 <#4> ctype_digit(NULL) called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php:77]
  #1 <#4> PhabricatorStandardCustomFieldDate::newDateControl() called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php:44]
  #2 <#4> PhabricatorStandardCustomFieldDate::renderEditControl(array) called at [<phorge>/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php:72]
  #3 <#4> PhabricatorCustomFieldEditField::buildControl() called at [<phorge>/src/applications/transactions/editfield/PhabricatorEditField.php:385]
  #4 <#4> PhabricatorEditField::renderControl() called at [<phorge>/src/applications/transactions/editfield/PhabricatorEditField.php:415]
  #5 <#4> PhabricatorEditField::appendToForm(AphrontFormView) called at [<phorge>/src/applications/transactions/controller/PhabricatorEditEngineConfigurationViewController.php:246]
  #6 <#4> PhabricatorEditEngineConfigurationViewController::buildFieldList(PhabricatorEditEngineConfiguration) called at [<phorge>/src/applications/transactions/controller/PhabricatorEditEngineConfigurationViewController.php:40]
  #7 <#4> PhabricatorEditEngineConfigurationViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #8 <#3> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #9 <#3> file_exists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1068]
  #10 <#3> Filesystem::pathExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1169]
  #11 <#3> Filesystem::assertExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1020]
  #12 <#3> Filesystem::isDescendant(NULL, string) called at [<phorge>/src/view/widget/AphrontStackTraceView.php:33]
  #13 <#3> AphrontStackTraceView::render() called at [<phorge>/src/view/AphrontView.php:222]
  #14 <#3> AphrontView::producePhutilSafeHTML() called at [<phorge>/src/infrastructure/markup/render.php:115]
  #15 <#3> phutil_escape_html(AphrontStackTraceView) called at [<phorge>/src/infrastructure/markup/render.php:139]
  #16 <#3> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:97]
  #17 <#3> phutil_tag(string, array, array) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:62]
  #18 <#3> PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #19 <#3> AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #20 <#2> AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #21 <#2> AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
  #22 phlog(PhutilAggregateException) called at [<phorge>/src/aphront/response/AphrontUnhandledExceptionResponse.php:32]
  #23 AphrontUnhandledExceptionResponse::setException(PhutilAggregateException) called at [<phorge>/webroot/index.php:46]

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.