Problem/Motivation
MyrestRedirectEventSubscriber::onRedirectToEditPage() runs on every request at priority 1000 and answers any path that resolves to /node/{nid} with a 301 to that node's edit form. On a back end with no public HTML that is the intended behaviour, but it is unconditional: a site that installs this module for its API and still serves node pages loses them, and nothing on the settings page says so. Its sibling behaviour, the front page redirect to the login form, is behind redirect_front_to_login and defaults to off.
Proposed resolution
- Put the redirect behind a setting of its own, defaulting to off, next to
redirect_front_to_loginon the settings form. - Add an update hook that switches it on for existing sites, since they have been living with the behaviour.
- Cover both states with a functional test.
Remaining tasks
Add the setting, the update and the tests.
User interface changes
A checkbox for the node redirect on the settings page.
API changes
None.
Issue fork myrest-3617569
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
Comment #4
sergeydruua commentedComment #6
sergeydruua commented