- Issue created by @adubovskoy
- 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺
It would be best practice to keep the MediaInterface and just fix the use to be based on core:
Drupal\media\MediaInterface
On /en/admin/content/media/20/refs :
TypeError: Drupal\media_entity_usage\Service\MediaUsageInfo::getRefsList(): Argument #1 ($media) must be of type Drupal\media_entity\MediaInterface, Drupal\media\Entity\Media given, called in /var/www/drupal/web/modules/contrib/media_entity_usage/src/Controller/MediaUsageController.php on line 16 in Drupal\media_entity_usage\Service\MediaUsageInfo->getRefsList() (line 31 of modules/contrib/media_entity_usage/src/Service/MediaUsageInfo.php).
Drupal\media_entity_usage\Controller\MediaUsageController->referencesPage(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 44)
Drupal\redirect_after_login\RedirectMiddleware->handle(Object, 1, 1) (Line: 68)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 53)
Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 38)
Drupal\tracer\StackMiddleware\TracesMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Needs review
9.1
Code
It would be best practice to keep the MediaInterface and just fix the use to be based on core:
Drupal\media\MediaInterface