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_login on 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

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

sergeydruua created an issue. See original summary.

  • sergeydruua committed 5d30ac31 on 1.0.x
    Issue #3617569: Make the redirect from a node page to its edit form...
sergeydruua’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergeydruua’s picture

Status: Fixed » Closed (fixed)