Crashes When Enabling The Module

Created on 17 March 2024, 8 months ago
Updated 13 April 2024, 7 months ago

Problem/Motivation

Installation is successful, crashes when enabling it:

TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string, array given in htmlspecialchars() (line 437 of /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Component/Utility/Html.php).

I see one simile issue reported here: Crash in module installer if a dependency is missing 🐛 Crash in module installer if a dependency is missing Active . This issue labeled as fixed, but didn't say how and which dependency module was missing. I went to the link provided in that topic, didn't find any clue. So I posted my problem here asking for help. Apologize for not understanding well on that issue.

My core is Drupal 10.2.1.

Steps to reproduce

Below is the error log message:

#0 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Component/Utility/Html.php(437): htmlspecialchars(Array, 11, 'UTF-8')
#1 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Component/Render/FormattableMarkup.php(268): Drupal\Component\Utility\Html::escape(Array)
#2 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Component/Render/FormattableMarkup.php(217): Drupal\Component\Render\FormattableMarkup::placeholderEscape(Array)
#3 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php(195): Drupal\Component\Render\FormattableMarkup::placeholderFormat('@requirements_m...', Array)
#4 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Component/Utility/ToStringTrait.php(15): Drupal\Core\StringTranslation\TranslatableMarkup->render()
#5 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/Messenger/Messenger.php(54): Drupal\Core\StringTranslation\TranslatableMarkup->__toString()
#6 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/Messenger/Messenger.php(46): Drupal\Core\Messenger\Messenger->addMessage(Object(Drupal\Core\StringTranslation\TranslatableMarkup), 'error', false)
#7 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/includes/install.inc(967): Drupal\Core\Messenger\Messenger->addError(Object(Drupal\Core\StringTranslation\TranslatableMarkup))
#8 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/modules/system/src/Form/ModulesListForm.php(463): drupal_check_module('symfony_mailer')
#9 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/modules/system/src/Form/ModulesListForm.php(481): Drupal\system\Form\ModulesListForm->buildModuleList(Object(Drupal\Core\Form\FormState))
#10 [internal function]: Drupal\system\Form\ModulesListForm->submitForm(Array, Object(Drupal\Core\Form\FormState))
#11 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/Form/FormSubmitter.php(129): call_user_func_array(Array, Array)
#12 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/Form/FormSubmitter.php(67): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#13 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/Form/FormBuilder.php(597): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#14 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm('system_modules', Array, Object(Drupal\Core\Form\FormState))
#15 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\system\Form\ModulesListForm), Object(Drupal\Core\Form\FormState))
#16 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#17 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#18 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#19 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#20 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#21 /chroot/home/aab0448d/86038db258.nxcli.io/html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#22 /chroot/home/aab0448d/86038db258.nxcli.io/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#23 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /chroot/home/aab0448d/86038db258.nxcli.io/html/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /chroot/home/aab0448d/86038db258.nxcli.io/html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#35 {main}

Proposed resolution

If dependency modules are required for installation and the reasons for the crash, could they be listed in the module page?

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: cannot reproduce

Version

1.4

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sdsc
  • 🇬🇧United Kingdom aaron.ferris

    The dependencies are listed in the module as

        "html2text/html2text": "^4.0.1",
        "symfony/mailer": "^5.3 || ^6.0",
        "tijsverkoyen/css-to-inline-styles": "^2.2"
    

    Are you pulling this module down via Composer?

    Aaron@*** % composer require 'drupal/symfony_mailer:^1.4'
    ./composer.json has been updated
    Running composer update drupal/symfony_mailer
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 3 installs, 0 updates, 0 removals
      - Locking drupal/symfony_mailer (1.4.1)
      - Locking html2text/html2text (4.3.1)
      - Locking tijsverkoyen/css-to-inline-styles (v2.2.7)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 3 installs, 0 updates, 0 removals
      - Downloading tijsverkoyen/css-to-inline-styles (v2.2.7)
      - Downloading html2text/html2text (4.3.1)
      - Downloading drupal/symfony_mailer (1.4.1)
      - Installing tijsverkoyen/css-to-inline-styles (v2.2.7): Extracting archive
      - Installing html2text/html2text (4.3.1): Extracting archive
      - Installing drupal/symfony_mailer (1.4.1): Extracting archive
    Generating autoload files
    96 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    phpstan/extension-installer: Extensions installed
    No security vulnerability advisories found.
    Aaron@*** contrib % drush en symfony_mailer
    >  [notice] Checked cy translation for symfony_mailer.
    >  [notice] Downloaded cy translation for symfony_mailer.
    >  [notice] Imported cy translation for symfony_mailer.
    >  [notice] Translations imported: 25 added, 15 updated, 0 removed.
    >  [notice] The configuration was successfully updated. 45 configuration objects updated.
    >  [notice] Message: One translation file imported. /25/ translations were added, /15/ 
    > translations were updated and /0/ translations were removed.
    > 
    >  [notice] Message: The configuration was successfully updated. There are /45/ configuration 
    > objects updated.
    > 
     [success] Successfully enabled: symfony_mailer
  • I just use composer to install it again and saw these files downloading:

    - Downloading symfony/css-selector (v6.4.3)
    - Downloading tijsverkoyen/css-to-inline-styles (v2.2.7)
    - Downloading html2text/html2text (4.3.1)
    - Downloading drupal/symfony_mailer (1.4.1)

    And then enabling it with no problem. So composer does the dependency trick!!

    Thank you very much! the ticket can be closed now.

  • 🇬🇧United Kingdom aaron.ferris

    Nice, glad its sorted.

  • Status changed to Closed: cannot reproduce 7 months ago
  • 🇬🇧United Kingdom adamps
Production build 0.71.5 2024