Steps to reproduce:
- PHP 8.2.5; Phorge at 4d9719539773167058cf2b6bf6309945f1c5adba, with D25179 applied on top
- Have already a Macro created at http://phorge.localhost/macro/
- Now create a new Pholio mock:
- Go to http://phorge.localhost/pholio/create/
- Enter a Name
- Upload file
- Click Create button
- In Comment textfield at bottom, in its toolbar, click Meme button
- In the Create Meme dialog, select a Macro, leave the Above and Below fields empty, click Llama Diorama button to create
- See markup in Comment textfield
- Click Add Comment at bottom
Results:
- Comment in Pholio Mock shows a red error message: trim(): Passing null to parameter #1 ($string) of type string is deprecated
- Get the following exception (four times repeated) in error log:
[2023-05-10 13:10:54] EXCEPTION: (RuntimeException) trim(): 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=master, ref.master=4d9719539773) #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261] #1 <#2> trim(NULL) called at [<phorge>/src/applications/macro/engine/PhabricatorMemeEngine.php:185] #2 <#2> PhabricatorMemeEngine::newAssetData(PhabricatorFile) called at [<phorge>/src/applications/macro/engine/PhabricatorMemeEngine.php:164] #3 <#2> PhabricatorMemeEngine::newAssetFile(PhabricatorFile) called at [<phorge>/src/applications/macro/engine/PhabricatorMemeEngine.php:75] #4 <#2> PhabricatorMemeEngine::newAsset() called at [<phorge>/src/applications/macro/controller/PhabricatorMacroMemeController.php:21] #5 <#2> PhabricatorMacroMemeController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284] #6 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorAjaxRequestExceptionHandler.php:27] #7 PhabricatorAjaxRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751] #8 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296] #9 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203] #10 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
Other comments:
Problem only happens for the first comment, no problem adding the second comment in the same mockup.
Cannot always reproduce the problem - reasons are unclear to me.