When trying to set the display of a file field, the Ajax spinner runs forever. Error log shows this PHP error:

Short version:
ArgumentCountError: Too few arguments to function Drupal\file_download_link\Plugin\Field\FieldFormatter\FileDownloadLink::__construct(), 7 passed in /core/lib/Drupal/Core/Field/FormatterPluginManager.php on line 67 and exactly 9 expected n Drupal\file_download_link\Plugin\Field\FieldFormatter\FileDownloadLink->__construct() (Zeile 66 in /modules/contrib/file_download_link/src/Plugin/Field/FieldFormatter/FileDownloadLink.php)

I can post the full error code but I guess it is not more helpful than that.

I am using Core Media module, Media type file, and this inside a paragraph
But should that even matter? Since I get the error when trying to configure display for the file field of the file media type.
Drupal version: 8.7.11

Comments

eigentor created an issue. See original summary.

danflanagan8’s picture

Thanks for the report, eigentor.

I haven't been running the tests on 8.7.x so I missed this error. I just ran the tests and confirmed the error occurs in 8.7.x.

https://www.drupal.org/pift-ci-job/1568404

I'll see what I can do.

danflanagan8’s picture

I explicitly added ContainerFactoryInterface to the formatters and that seemed to do the trick. Perhaps one of the parent classes removed that interface at some point? Seems to be back in 8.8.x. Here's a patch for anyone on 8.7.x.

danflanagan8’s picture

Status: Active » Needs review

  • danflanagan8 committed 30be9be on 8.x-1.x
    Issue #3111666 by danflanagan8, eigentor: Error when trying to set...
danflanagan8’s picture

Status: Needs review » Fixed
danflanagan8’s picture

Status: Fixed » Closed (fixed)

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