How do I modify a custom entity delete form? I have a custom entity "Possession" that I created that has a non-standard edit form route to help facilitate a decending url structure. The routing for the edit form looks like this:

entity.possession.edit:
path: '/individual/{individual}/possession/{possession}/edit'
defaults:
  _entity_form: 'possession.edit'
  _title: 'Edit Possession'
requirements:
  _permission: 'access administration pages'
options:
  _admin_route: FALSE 
  parameters:
    individual:
      type: entity:individual
    possession:
      type: entity:possession


That seems to be working fine, but now the Delete form isn't working properly. When I click on "delete" the page white screens with this error: 

The website encountered an unexpected error. Please try again later.
Symfony\Component\Routing\ExceptionMissingMandatoryParametersException: Some mandatory 
parameters are missing ("individual") to generate a URL for route "entity.possession.edit_form". 
in Drupal\Core\Routing\UrlGenerator-&gt;doGenerate() 
(line 182 of core/lib/Drupal/Core/Routing/UrlGenerator.php).


After a little bit of digging I noticed that the reason that the Delete form would be complaining about the edit form route is that the cancel link on the Delete form directs you to the edit form, so it needs those parameters form the link. I ran into this problem previously with the List Builder page for this entity, but I just fixed it in the code for that page. 

For this I tried to edit the PossessionDeleteForm.php file that was generated when I created this entity through Drupal Console. I added a buildForm method to the empty class to a variation of this: 

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  $entity = $this-&gt;entity;

  $form['actions']['cancel']['#url'] =  Url::fromRoute('entity.possession.edit_form', [
  'possession' =&gt; $entity-&gt;id(),
  'individual' =&gt; $entity-&gt;get('individual_id')-&gt;target_id,
  ]);  
  return $form; 
}


If I throw a ksm() in there to inspect that it seems like it's set up correctly, but it doesn't seem to have any change on the message that I'm recieving on the white screen. I also tried adding the getCancelURL() method to the class with a basic URL:

public function getCancelURL() {
  return new Url('system.admin_content');
}


Still nothing.

Next I tried the urlRouteParamters() method in the actual Entity class:

protected function urlRouteParameters($rel) {
  $uri_route_parameters = parent::urlRouteParameters($rel);

  if ($rel === 'edit_form') {   
    $uri_route_parameters['individual'] = $this-&gt;get('individual_id')-&gt;target_id;

  }
  return $uri_route_parameters;
}


That also didn't work. I have no idea what else to do here. Does anyone have any suggestions?
The relationship is the key of the url relationships, aka edit-form, not edit_form. Try that in urlRouteParameters() and what you are doing should work.