Homestyx hydra
Diffusion hydra 8e09dbfee343

Fix PHP 8.1 exception creating task when custom select field configured

Description

Fix PHP 8.1 exception creating task when custom select field configured

Summary:
strlen() was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts phutil_nonempty_string() as a replacement.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.

EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php:14]

Closes T15691

Test Plan: After configuring a custom select field, try to create a task via a Maniphest form using that custom field.

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15691

Differential Revision: https://we.phorge.it/D25494

Details

Provenance
Andre KlapperAuthored on Dec 18 2023, 6:22 PM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:40d10fbe1ae6: Fix PHP 8.1 "strlen(null)" exception when custom select field configured
Branches
Unknown
Tags
Unknown

Event Timeline