Page MenuHomePhorge

Calendar: Fix PHP 8.1 strlen(null) from AphrontFormDateControlValue.php:72 when visiting the Event Create form with start and end dates (without time)
Closed, ResolvedPublic

Description

While visiting this form:

http://phorge.localhost/calendar/event/edit/form/default/?start=1747749600&end=1747753200

(Arrived to that page from this page: http://phorge.localhost/calendar/query/month/2025/05/20/ and clicking on Create Event)

Stack trace:

strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [AphrontFormDateControlValue.php:72]
AphrontFormDateControlValue::newFromRequest called at [/home/boz/repos/phorge/src/aphront/httpparametertype/AphrontEpochHTTPParameterType.php:23]
AphrontEpochHTTPParameterType::getParameterValue called at [/home/boz/repos/phorge/src/aphront/httpparametertype/AphrontHTTPParameterType.php:88]
AphrontHTTPParameterType::getValue called at [/home/boz/repos/phorge/src/applications/transactions/editfield/PhabricatorEditField.php:632]
PhabricatorEditField::getHTTPParameterValue called at [/home/boz/repos/phorge/src/applications/transactions/editfield/PhabricatorEditField.php:551]
PhabricatorEditField::getValueFromRequest called at [/home/boz/repos/phorge/src/applications/transactions/editfield/PhabricatorEditField.php:503]
PhabricatorEditField::readValueFromRequest called at [/home/boz/repos/phorge/src/applications/transactions/editengine/PhabricatorEditEngine.php:1217]
PhabricatorEditEngine::buildEditResponse called at [/home/boz/repos/phorge/src/applications/transactions/editengine/PhabricatorEditEngine.php:1010]
PhabricatorEditEngine::buildResponse called at [/home/boz/repos/phorge/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php:93]
PhabricatorCalendarEventEditController::handleRequest called at [/home/boz/repos/phorge/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
AphrontApplicationConfiguration::processRequest called at [/home/boz/repos/phorge/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
AphrontApplicationConfiguration::runHTTPRequest called at [/home/boz/repos/phorge/webroot/index.php:35]

So this seems the affected line:

https://we.phorge.it/source/phorge/browse/master/src/view/form/control/AphrontFormDateControlValue.php;f4d3c968461ed7ac2af4db97823564752bb2d44c$72

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.