Conflict with library discovery core class

Created on 19 December 2024, 4 months ago

Problem/Motivation

Error:

TypeError: Drupal\geolocation\MapFeatureBase::__construct(): Argument #7 ($libraryDiscovery) must be of type Drupal\Core\Asset\LibraryDiscovery, Drupal\Core\Asset\LibraryDiscoveryCollector given.
In this list of files:

/geolocation/modules/geolocation_geometry/src/Plugin/Validation/Constraint/GeometryConstraint.php
/geolocation/modules/geolocation_geometry/src/Plugin/Validation/Constraint/GeometryConstraintValidator.php
/geolocation/modules/geolocation_leaflet/src/Plugin/geolocation/LayerFeature/LeafletMarkerIcon.php
/geolocation/src/LayerFeatureBase.php
/geolocation/src/MapFeatureBase.php
/geolocation/src/Plugin/geolocation/MapFeature/ControlCustomGeocoder.php
/geolocation/src/Plugin/geolocation/MapFeature/ControlTileLayers.php

Core "library.discovery" service is an instance of LibraryDiscoveryCollector, but these classes expects a Library discovery.

Drupal Core: 11.1.0
Geolocation: 4.0.0-alpha7

Steps to reproduce

With the versions above, create a field and enter in display settings of the field.

Proposed resolution

Use LibraryDiscoveryInterface instead of LibraryDiscovery

Patch attached.

🐛 Bug report
Status

Active

Version

4.0

Component

Geolocation Field / Backend

Created by

🇪🇸Spain toleillo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024