The current -dev snapshot of dropzonejs has this error when it's installed via an install profile:

ArgumentCountError: Too few arguments to function Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget\DropzoneJsEbWidget::__construct(), 9 passed in /opt/atlassian/pipelines/agent/build/web/modules/contrib/dropzonejs/modules/eb_widget/src/Plugin/EntityBrowser/Widget/MediaEntityDropzoneJsEbWidget.php on line 65 and exactly 10 expected in Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget\DropzoneJsEbWidget->__construct() (line 83 of /opt/atlassian/pipelines/agent/build/web/modules/contrib/dropzonejs/modules/eb_widget/src/Plugin/EntityBrowser/Widget/DropzoneJsEbWidget.php).
#1 /opt/atlassian/pipelines/agent/build/web/modules/contrib/dropzonejs/modules/eb_widget/src/Plugin/EntityBrowser/Widget/MediaEntityDropzoneJsEbWidget.php(83): Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget\MediaEntityDropzoneJsEbWidget->__construct(Array, 'dropzonejs_medi...', Array, Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher), Object(Drupal\Core\Entity\EntityTypeManager), Object(Drupal\entity_browser\WidgetValidationManager), Object(Drupal\dropzonejs\DropzoneJsUploadSave), Object(Drupal\Core\Session\AccountProxy), Object(Drupal\token\Token), Object(Drupal\Core\Extension\ModuleHandler))
#2 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget\MediaEntityDropzoneJsEbWidget::create(Object(Drupal\Core\DependencyInjection\ContainerBuilder), Array, 'dropzonejs_medi...', Array)
#3 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('dropzonejs_medi...', Array)
#4 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(81): Drupal\Component\Plugin\PluginManagerBase->createInstance('dropzonejs_medi...', Array)
#5 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin('16b62361-2b6e-4...')
#6 /opt/atlassian/pipelines/agent/build/web/modules/contrib/entity_browser/src/WidgetsCollection.php(17): Drupal\Component\Plugin\LazyPluginCollection->get('16b62361-2b6e-4...')
#7 [internal function]: Drupal\entity_browser\WidgetsCollection->sortHelper('fce60bbf-f18b-4...', '16b62361-2b6e-4...')
#8 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(90): uasort(Array, Array)
#9 /opt/atlassian/pipelines/agent/build/web/modules/contrib/entity_browser/src/Entity/EntityBrowser.php(281): Drupal\Core\Plugin\DefaultLazyPluginCollection->sort()
#10 /opt/atlassian/pipelines/agent/build/web/modules/contrib/entity_browser/src/Entity/EntityBrowser.php(258): Drupal\entity_browser\Entity\EntityBrowser->getWidgets()
#11 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(292): Drupal\entity_browser\Entity\EntityBrowser->getPluginCollections()
#12 /opt/atlassian/pipelines/agent/build/web/modules/contrib/entity_browser/src/Entity/EntityBrowser.php(410): Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#13 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(499): Drupal\entity_browser\Entity\EntityBrowser->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#14 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(454): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\entity_browser\Entity\EntityBrowser))
#15 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(263): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\entity_browser\Entity\EntityBrowser))
#16 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Entity/EntityBase.php(394): Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\entity_browser\Entity\EntityBrowser))
#17 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(613): Drupal\Core\Entity\EntityBase->save()
#18 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(364): Drupal\Core\Config\Entity\ConfigEntityBase->save()
#19 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Config/ConfigImporter.php(979): Drupal\Core\Config\Entity\ConfigEntityStorage->importCreate('entity_browser....', Object(Drupal\Core\Config\Config), Object(Drupal\Core\Config\Config))
#20 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Config/ConfigImporter.php(765): Drupal\Core\Config\ConfigImporter->importInvokeOwner('', 'create', 'entity_browser....')
#21 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Config/ConfigImporter.php(592): Drupal\Core\Config\ConfigImporter->processConfiguration('', 'create', 'entity_browser....')
#22 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Config/ConfigImporter.php(496): Drupal\Core\Config\ConfigImporter->processConfigurations(Array)
#23 /opt/atlassian/pipelines/agent/build/web/core/lib/Drupal/Core/Config/Importer/ConfigImporterBatch.php(30): Drupal\Core\Config\ConfigImporter->doSyncStep('processConfigur...', Array)
#24 /opt/atlassian/pipelines/agent/build/web/core/includes/batch.inc(295): Drupal\Core\Config\Importer\ConfigImporterBatch::process(Object(Drupal\Core\Config\ConfigImporter), 'processConfigur...', Array)
#25 /opt/atlassian/pipelines/agent/build/web/core/includes/form.inc(893): _batch_process()
#26 /opt/atlassian/pipelines/agent/build/web/core/includes/install.core.inc(665): batch_process(Object(Drupal\Core\Url), Object(Drupal\Core\Url))
#27 /opt/atlassian/pipelines/agent/build/web/core/includes/install.core.inc(583): install_run_task(Array, Array)
#28 /opt/atlassian/pipelines/agent/build/web/core/includes/install.core.inc(118): install_run_tasks(Array, NULL)
#29 /opt/atlassian/pipelines/agent/build/vendor/drush/drush/includes/drush.inc(728): install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#30 /opt/atlassian/pipelines/agent/build/vendor/drush/drush/includes/drush.inc(713): drush_call_user_func_array('install_drupal', Array)
#31 /opt/atlassian/pipelines/agent/build/vendor/drush/drush/commands/core/drupal/site_install.inc(82): drush_op('install_drupal', Object(Composer\Autoload\ClassLoader), Array)
#32 /opt/atlassian/pipelines/agent/build/vendor/drush/drush/commands/core/site_install.drush.inc(271): drush_core_site_install_version('gt_it', Array)
#33 /opt/atlassian/pipelines/agent/build/vendor/drush/drush/includes/command.inc(422): drush_core_site_install('gt_it', 'install_configu...', 'install_configu...')
#34 /opt/atlassian/pipelines/agent/build/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#35 /opt/atlassian/pipelines/agent/build/vendor/drush/drush/includes/command.inc(199): drush_command('mysite', 'install_configu...', 'install_configu...')
#36 /opt/atlassian/pipelines/agent/build/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#37 /opt/atlassian/pipelines/agent/build/vendor/drush/drush/includes/preflight.inc(67): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#38 /opt/atlassian/pipelines/agent/build/vendor/drush/drush/drush.php(12): drush_main()
#39 {main}

(the above is from a Bitbucket pipeline's console)

CommentFileSizeAuthor
#4 3086804.patch13.4 KBchr.fritsch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna created an issue. See original summary.

DamienMcKenna’s picture

MediaEntityDropzoneJsEbWidget::__construct() looks like this:

  public function __construct(array $configuration, $plugin_id, $plugin_definition, EventDispatcherInterface $event_dispatcher, EntityTypeManagerInterface $entity_type_manager, WidgetValidationManager $validation_manager, DropzoneJsUploadSaveInterface $dropzonejs_upload_save, AccountProxyInterface $current_user, Token $token, ModuleHandlerInterface $module_handler) {
    parent::__construct($configuration, $plugin_id, $plugin_definition, $event_dispatcher, $entity_type_manager, $validation_manager, $dropzonejs_upload_save, $current_user, $token);

However, DropzoneJsEbWidget::__construct() looks like this:

  public function __construct(array $configuration, $plugin_id, $plugin_definition, EventDispatcherInterface $event_dispatcher, EntityTypeManagerInterface $entity_type_manager, WidgetValidationManager $validation_manager, DropzoneJsUploadSaveInterface $dropzonejs_upload_save, AccountProxyInterface $current_user, Token $token, FileSystemInterface $fileSystem) {

So the parent::__construct() in MediaEntityDropzoneJsEbWidget::__construct() needs to add the $fileSystem argument.

DamienMcKenna’s picture

chr.fritsch’s picture

Status: Active » Needs review
FileSize
13.4 KB

Oh noze... 🤦🏻‍♂️

So I took the opportunity to remove all constructors and use setter injection instead. That way is much better because the create() function is BC stable. constructors are not.

fonant’s picture

Patch fixed the problem with dropzonejs for me, thank you!

chr.fritsch’s picture

Status: Needs review » Reviewed & tested by the community

Marking RTBC based on #5

  • chr.fritsch committed 691a327 on 8.x-2.x
    Issue #3086804 by chr.fritsch: Too few arguments to function...
chr.fritsch’s picture

Status: Reviewed & tested by the community » Fixed

Fixed

Status: Fixed » Closed (fixed)

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