Problem/Motivation

Sub-pathauto makes URLs work which are only partly covered by a URL alias. Fast 404 checks if a URL matches an existing route or alias and causes a 404 response if the requested URL does not match. For example node/123 with alias /foo/bar. With sub-pathauto the URL /foo/bar/baz will show the display of the node/123. But with both sub-pathauto and Fast 404 installed, the URL /foo/bar/baz will return a 'page not found'. This is because Fast 404 checks the given URL directly against the aliases in the database table of url_alias. It is not aware of Sub Pathauto nor it's depth setting.

My temporary workaround is to disable the path checking by Fast 404 using $conf['fast_404_path_check'] = FALSE; in the settings.php file.

Steps to reproduce

  1. Install the subpathauto module
  2. Visit a node edit form (this should return a 404)
  3. Visit a node revision (this should return a 404)
  4. Try to revert a node revision (this should return a 404)

Proposed resolution

Fast 404 allows other modules to override the queries used to check agains the database tables. Sub-pathauto adds its own logic.

Remaining tasks

Discuss the solution.
Fix it.

User interface changes

none

API changes

Add a hook to fast_404 to allow interaction by other modules

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

seanB’s picture

This adds an optional extra check for subpathauto which removes the last part of the URL when checking for paths.

seanB’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev

Let's run a test for 8.x since that is what the patch is for.

NickDickinsonWilde’s picture

Status: Needs review » Needs work

Doesn't seem to apply/incomplete patch?

seanB’s picture

Status: Needs work » Needs review
FileSize
799 bytes

Reroll for 3.x.

seanB’s picture

Project: Sub-pathauto (Sub-path URL Aliases) » Fast 404
Version: 8.x-1.x-dev » 8.x-3.x-dev

Whoops, this is a patch for the Fast404 module. Sorry about that. Let's move the issue.

seanB’s picture

Attached patch adds support for node revisions.

Kristen Pol’s picture

This needs concrete steps to reproduce in the issue summary so tagging.

seanB’s picture

Issue summary: View changes
FileSize
882 bytes
1.21 KB

The revision related URLs can be more than just /revisions/[ID]/view, eg /revisions/[ID]/revert and /revisions/[ID]/revert/nl. Updated to regex to support this. Also added a check for the subpathauto module.

Tried to update the IS as well to provide basic steps to reproduce the issue.

Kristen Pol’s picture

Thanks! Tagging for testing.