Problem/Motivation

Installing Extra Paragraph Types (EPT): Call to Action 2.0.1 with EPT Core 2.0.0 causes a fatal ArgumentCountError.

The CTA field widget extends EptSettingsDefaultWidget, whose constructor now requires ModuleHandlerInterface and EntityTypeManagerInterface. The CTA widget does not inject or pass these services to the parent constructor.

This appears to be the same type of EPT 2.x constructor incompatibility reported in #3609032. That issue resulted in corrected releases for modules such as EPT Image Gallery, but EPT CTA still contains the old constructor call.

Steps to reproduce

1. Require the 2.x version of EPT CTA:

composer require drupal/ept_cta:^2.0

2. Enable EPT CTA and its dependencies.
3. Drupal attempts to install the CTA paragraph form-display configuration.
4. Installation fails with an ArgumentCountError.

The following fatal error occurs:

ArgumentCountError: Too few arguments to function Drupal\ept_core\Plugin\Field\FieldWidget\EptSettingsDefaultWidget::__construct(), 5 passed in modules/contrib/ept_cta/src/Plugin/Field/FieldWidget/EptSettingsCtaWidget.php on line 49 and exactly 7 expected.

The failure can also leave the module partially installed. In my case, Drupal marked ept_cta as enabled and installed most of its default configuration, but did not install:

core.entity_form_display.paragraph.ept_cta.default

Comments

bdunphy created an issue. See original summary.

  • levmyshkin committed 177a8e74 on 2.0.x
    Issue #3616372 by levmyshkin: Fix ArgumentCountError by injecting...
levmyshkin’s picture

Hi bdunphy, I fixed the problem and rolled up 2.0.2 release:
https://www.drupal.org/project/ept_cta/releases/2.0.2

You need to update EPT CTA module to fix the problem on your site:
composer update drupal/ept_cta

levmyshkin’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

levmyshkin’s picture

Status: Fixed » Closed (fixed)
bdunphy’s picture

Thank you levmyshkin! The Extra Paragraph Types core & submodules is amazing work. These have solved a number of issues for sites I'm working on.