Allow display plugins with routes to define more than path

Created on 27 October 2014, about 10 years ago
Updated 7 February 2024, 10 months ago

Problem/Motivation

Right now \Drupal\entity_browser\Entity\EntityBrowser::route() collects path from display plugin and adds some sane defaults when creating route object. We should allow display plugins to have more power over how route looks like (requirements, defining admin route, ....).

Proposed resolution

There are more possible solutions:
- display plugin creates full Route objects and EntityBrowser only overrides some things if needed
- keep Route creation in EntityBrowser and allow display plugin to return more info than just path string

There are probably more options but those two sound the simplest and most obvious ones.

Remaining tasks

- decide on solution
- code patch
- adapt tests
- review patch

User interface changes

N/A

API changes

Might change return value of \Drupal\entity_browser\Plugin\EntityBrowser\Display\DisplayRouterInterface::path() will probably change. Maybe we'll even kill that function and entirely replace it with a new one.

📌 Task
Status

Needs review

Version

1.0

Component

Core API

Created by

🇸🇮Slovenia slashrsm

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024