Bug #23046
Duplicate

Template Route Issue

I am still expereincing the same bug that was reported back on 31st March 2016 (over a year ago!). https://expressionengine.com/support/bugs/21633/template-routes-with-static-segments-and-require-all-set-to-no-error

I am running EE 3.5.4 and when I save a template route like:

contact/{alpha_dash} with ‘segments required’ set to ‘no’, only if a segment 2 is present will the page display. If only segment 1 of ‘contact’ is present a blank page displays.

Applying the temporary fix displayed in the previous bug report does fix the issue, but I don’t understand why I am having to apply this to every project I work on when the bug has been known for over a year.

A response explaining why would be greatly appreciated.

Marking this as a duplicate of #21633, please just email us in the future.

Sorry for the trouble, Chris. The reason is the problem is more complicated than it seems. We spent weeks on a fix for this only to find a larger design flaw in how routes are parsed, but also realized that sites may be relying on that design flaw. So we couldn’t introduce a change in a minor release that would break folks’ sites. A major version maybe, so we’re saving a fix for something more like a 4.0 or 5.0 release. The code being deleted in the temporary fix is there for a reason so we have not implemented that as the fix.

As a workaround to avoid hacking, could you create a contact template group and let that template handle the requests when there is no second segment? You would be able to stay DRY by embedding the actual template, with no other tags on contact/index.

Username

Password

Email Address

Used to log in

Display Name

Password

By registering, you agree to our terms of service, including receiving some tips and offers from us from time to time. We never spam, and we never share your email address with third parties. Terms of ServicePrivacy Policy