- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
-
+++ b/core/lib/Drupal/Core/Entity/EntityListBuilder.php @@ -65,11 +82,17 @@ public static function createInstance(ContainerInterface $container, EntityTypeI + $this->linkGenerator = $link_generator;
Is the disruption of injecting the link generator worth it?
All the other links we generate in this class (e.g. in operations) don't need/use it so that makes me feel we may not need it.
That would dramatically reduce the complexity of this patch and the disruption to contrib.
-
+++ b/core/lib/Drupal/Core/Entity/EntityListBuilder.php @@ -248,4 +269,61 @@ protected function ensureDestination(Url $url) { + Url::fromUri('internal:' . $this->entityType->getLinkTemplate('add-page')) ... + Url::fromUri('internal:' . $this->entityType->getLinkTemplate('add-form'))
Is internal: our only option here?
\Drupal\Core\Entity\Controller\EntityController::addPage
usesLink::createFromRoute
-
+++ b/core/lib/Drupal/Core/Entity/EntityListBuilder.php @@ -248,4 +269,61 @@ protected function ensureDestination(Url $url) { + elseif ($this->entityType->hasLinkTemplate('add-form')) {
This could return an exception if there is no add page link template, but there is an add-form link template but it requires additional parameters. So we probably would need a try/catch here.
Also, we don't need elseif, there's a return above.
- Coming from 🐛 Remove duplicate "add block" link from block content type view's "Results not found" message Postponed I was expecting to see something here for admin lists that are built with views, as in reality most content-entity list builders are overridden with a view. It would be good to get an issue summary update here to address what the intended course of action is there.
-
- 🇦🇺Australia acbramley
I would like to unblock 🐛 Remove duplicate "add block" link from block content type view's "Results not found" message Postponed which was postponed based on #121.4
IMO having duplicate links on a page that go to the same place isn't necessary. The action buttons are a much more prominent pattern in core and things like Node and Media don't and haven't had an Add link in the views table so people will be used to using the Add content/media buttons.
If we still want the duplicate link in the list controller table that this issue is adding I think that's fine, but adding a generic area plugin for views seems like a much larger task and should either be agreed as a won't fix or moved to a separate issue?