Block, Shortcut and View config entities do not respect URI callbacks specified via entity info (see the EntityManager class). They directly override Entity::uri() as follow what skips the logic to take account of the entity uri callback:

  /**
   * Overrides Drupal\Core\Entity\EntityInterface::uri().
   */
  public function uri() {
    return array(
      'path' => 'admin/structure/views/view/' . $this->id(),
    );
  }

We should a) fix this and b) improve docs that is clear how this is supposed to work.

Related issues:
#1899816: Various config entity types are missing URI callbacks
#1803586: Give all entities their own URI

Comments

fago’s picture

What about following the way of the d7 entity module?
- Default to the callback Entity::defaultUri() in entity::uri()
- Default to NULL in the callback such that the default handling does not change
- Override defaultUri() for each entity type?

tim.plunkett’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)