Problem/Motivation

After installing the module and navigating to /admin/config/media/filepond, the following fatal error is thrown:

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:
You have requested a non-existent service "plugin.manager.media.source".
in Drupal\Component\DependencyInjection\Container->get()
(line 157 of /web/core/lib/Drupal/Component/DependencyInjection/Container.php).

The root cause is that drupal:media is not declared as a dependency in filepond.info.yml, so Drupal does not enforce the media module being enabled before FilePond is installed. The module however directly uses MediaType::loadMultiple() and implements hook_media_source_info_alter(), both of which require the media module and its services to be available.

Steps to reproduce

  1. Install Drupal 11.x with the FilePond module enabled but without explicitly enabling the media module.
  2. Navigate to /admin/config/media/filepond.
  3. Observe the fatal ServiceNotFoundException for plugin.manager.media.source.

Proposed resolution

Add drupal:media to the dependencies list in filepond.info.yml:

dependencies:
   - drupal:file
   - drupal:system
+  - drupal:media

Issue fork filepond-3605433

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dkmishra created an issue. See original summary.

dkmishra’s picture

Status: Active » Needs review
loze’s picture

Status: Needs review » Fixed

Thanks for reporting.

I didn't want to make media a hard requirement, though. The form element and image field widget work on plain file fields, so I'd rather not force media on sites that don't use it. Instead I made the media bits optional: the settings form only loads the media source service and shows the Media Library toggle when media is actually installed, and the media upload routes now register only when the media module is enabled.

So it works without media now, and behaves exactly as before with it. This is in 1.0.x. And should resolve the error you were seeing.

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.

Status: Fixed » Closed (fixed)

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