In EntityListBuilder::getDefaultOperations action links point to various forms like edit and delete. Since this is a list of entities I think user should return to it after he performs the action instead to the entity view page.

This code: https://api.drupal.org/api/drupal/core%21modules%21node%21src%21NodeList... shows an example of how to add a destination.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikedotexe’s picture

Title: Add destination query argument to EntityListController::getOperations actions » Add destination query argument to EntityListBuilder::getDefaultOperations actions
Issue summary: View changes
serundeputy’s picture

The function `getDefaultOperations` is overridden on the `admin/content` view and on that override they have a `destination` https://api.drupal.org/api/drupal/core%21modules%21node%21src%21NodeList...

So, it is determined that this is a good idea we can implement similar $destination in this function.

serundeputy’s picture

Issue summary: View changes
serundeputy’s picture

Version: 8.0-alpha7 » 8.2.x-dev

changing to `8.2.x` to reflect current code state.

Darren Oh’s picture

Issue tags: +neworleans2016
Darren Oh’s picture

Priority: Normal » Minor

Setting priority to minor because this can easily be overridden.

Darren Oh’s picture

Title: Add destination query argument to EntityListBuilder::getDefaultOperations actions » Add default destination query to EntityListBuilder::getDefaultOperations actions
Status: Active » Needs review
FileSize
1.49 KB

Status: Needs review » Needs work

The last submitted patch, 7: add_destination_query-2165585-7.patch, failed testing.

Darren Oh’s picture

Status: Needs work » Needs review
FileSize
3.04 KB

Status: Needs review » Needs work

The last submitted patch, 9: add_default_destination-2165585-9.patch, failed testing.

codexmas’s picture

Having just encountered an issue with destinations being stripped and a lot of debugging, I think adding the 'query' info directly to the operation isn't the right way.

The correct way is to use the Url->setOption('query', $destination) method instead.
Given that $destination is an array of ['destination'] => '/some/path'

Perhaps the 'query' part of the operation is a remnant of render arrays?

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

alexpott’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2767857: Add destination to edit, delete, enable, disable links in entity list builders

This is a duplicate of #2767857: Add destination to edit, delete, enable, disable links in entity list builders - well this was a duplicate of that but it got committed so...