Skip to content

Conversation

@mambax7
Copy link
Collaborator

@mambax7 mambax7 commented Jul 31, 2016

When I change a theme, I should stay where I am, and not being redirected to "Home"

@geekwright
Copy link
Contributor

While I agree it is much more intuitive (and hence desirable) to remain on the same page, I fear this might open up some random issues.

The block may appear on any page, including pages which may be capable of making updates. This change will toss a random "POST" to them. In a perfect world, all the scripts that might be invoked this way would recognize that the POST transaction was not relevant, and take no action. I fear we don't work in a perfect world, and some modules might execute random garbage updates in some cases when presented with this situation.

Since there is no way to guarantee it is safe to invoke every possible script this way, we point the action to a safe point. The main page is presumably safe to enter, even with a post method. I think that is the rational for the less than optimal behavior.

@mambax7
Copy link
Collaborator Author

mambax7 commented Jul 31, 2016

It's a nightmare when testing a particular link in various themes, as I just did with Publisher yesterday - when you switch a theme, and then have to go back and refresh in order to see the link in the other theme :(

@geekwright
Copy link
Contributor

Sounds like you need a developer tool, while the theme block is for general use and thus needs to be more protected. Perhaps we should have a devtool module? I don't mind developers assuming their own risks, but I've seen sites with the theme block active for regular users, and I've seen some modules that could get confused (best case strange errors, worst case trashing data.)

Workflow workaround I've used, open two tabs into the site you are working on, one on the front page to switch themes, and another tab on the page you are checking. Change on first, reload on second. Still an extra step, but less effort to get back to the right place.

@geekwright geekwright closed this Feb 2, 2017
@mambax7 mambax7 deleted the feature/theme_block_redirect branch April 17, 2019 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants