Problem/Motivation

The state transition form always redirects the user to the transitioned entity when a confirmation is required. When the form is display on another page, a views for example, it is a bit clunky to have to go back to the previous page manually.

Proposed resolution

We could always redirect the state transition form to the current path which should be most of the time the transitioned entity but would allow a bit more flexibility.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Aerzas created an issue. See original summary.

aerzas’s picture

aerzas’s picture

Status: Active » Needs review
Issue tags: +Needs review
johnpitcairn’s picture

Status: Needs review » Reviewed & tested by the community

Code looks good to me, and this is very useful in commerce admin views with a state transition form per row. Marking RTBC for maintainer attention.

This will change behaviour though, and some sites may be relying on going to the entity view page after transition page, so I wonder if it needs to be an opt-in or opt-out with a setting somewhere? Perhaps a 3rd-party setting per entity type would be appropriate.

nikita_tt’s picture

Thanks for the patch. It works well.

jsacksick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -

There's a destination service, let's use it instead of the current path.

aerzas’s picture

Status: Needs work » Needs review

@jsacksick Good point !

I rebased the branch on the latest 8.x-1.x branch, updated the code with the destination service and fixed the functional test (which seemed unrelated).

aerzas’s picture

  • jsacksick committed 6299c024 on 8.x-1.x authored by Aerzas
    Issue #3292818 by Aerzas: Redirect state transition form to current path
    
jsacksick’s picture

Status: Needs review » Fixed

Merged, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.