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
Comment #3
levmyshkinHi 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
Comment #4
levmyshkinComment #6
levmyshkinComment #7
bdunphy commentedThank you levmyshkin! The Extra Paragraph Types core & submodules is amazing work. These have solved a number of issues for sites I'm working on.