Problem/Motivation

I've just installed the postoffice_html2text sub module and received the following error:

The website encountered an unexpected error. Try again later.

TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /path/to/my/site/web/core/lib/Drupal/Component/Render/FormattableMarkup.php on line 238 in Drupal\Component\Utility\Html::escape() (line 431 of core/lib/Drupal/Component/Utility/Html.php).
Drupal\Component\Render\FormattableMarkup::placeholderEscape(NULL) (Line: 187)
Drupal\Component\Render\FormattableMarkup::placeholderFormat('@requirements_message (Currently using @item version @version)', Array) (Line: 195)
Drupal\Core\StringTranslation\TranslatableMarkup->render() (Line: 15)
Drupal\Core\StringTranslation\TranslatableMarkup->__toString() (Line: 54)
Drupal\Core\Messenger\Messenger->addMessage(Object, 'error', ) (Line: 46)
Drupal\Core\Messenger\Messenger->addError(Object) (Line: 679)
drupal_check_module('postoffice_html2text') (Line: 465)
Drupal\system\Form\ModulesListForm->buildModuleList(Object) (Line: 483)
Drupal\system\Form\ModulesListForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 105)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 43)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 589)
Drupal\Core\Form\FormBuilder->processForm('system_modules', Array, Object) (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Install postoffice and postoffice_html2text. Error happens immediately.

Proposed resolution

OP to investigate if problem is specific to this site or a bug in the module.
Others to attempt to reproduce issue and report results.

Remaining tasks

Investigate.
Possibly fix.
If problem is localised report back for future Googlers!

User interface changes

N/A.

API changes

N/A.

Data model changes

N/A.

Issue fork postoffice-3511391

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

darren.fisher created an issue. See original summary.

znerol’s picture

Hi, thanks for the report. Could you please check whether this problem is specific to a certain PHP version? I.e., if you are using PHP 8.4, could you check whether it persists if you switch to PHP 8.3? Thanks.

znerol’s picture

Version: 1.2.1 » 1.2.x-dev
Status: Active » Needs review

I was able to reproduce the problem. It has nothing to do with the PHP version. A fix will be available shortly.

  • znerol committed 13d960a2 on 1.2.x
    Issue #3511391: Postoffice HTML2text postoffice_html2text TypeError:...
znerol’s picture

Status: Needs review » Fixed
d.fisher’s picture

Oh nice. That was quick!! Thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.