Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
404 when article_url matches a section name in "Title only". Bug?
You can reproduce this on the test demo (currently showing until next demo refresh on the hour):
Section = testing
Section is set to \Title url scheme
Article “testing” is assigned to the testing section.
Article “one-two-three” is assigned to the testing section.
Results:
\testing\testing --> is found
\testing\2\testing --> is found
\testing\ --> shows landing page
\testing --> 404 (but this is what I want)
\one-two-three --> is found
I can work around it, of course, by changing either the section or article title. Is this a known anomaly?
TXP Builders – finely-crafted code, design and txp
Offline
Re: 404 when article_url matches a section name in "Title only". Bug?
Does the result change in your favour if you alter the Preference for trailing slashes?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: 404 when article_url matches a section name in "Title only". Bug?
Thanks! Didn’t think of that.
But unfortunately that doesn’t help. While setting to “no” allows you to reach the URL, you get the landing page, not the article. Here’s an overview:
With trailing slashes set to no:
/testing/testing --> page is found
/testing/testing/ --> 404 - not found
/testing --> shows landing page
/testing/ --> 404 - not found
With trailing slashes set to yes:
/testing/testing --> 404 - not found
/testing/testing/ --> is found
/testing --> 404 - not found
/testing/ --> shows landing page
With trailing slashes set to list:
/testing/testing --> page is found
/testing/testing/ --> page is found
/testing --> 404 - not found (this should be the individual article, I think)
/one-two-three --> page is found (individual article)
/testing/ --> shows landing page
TXP Builders – finely-crafted code, design and txp
Offline
Re: 404 when article_url matches a section name in "Title only". Bug?
That’s not exactly a bug, rather a processing simplification. If an article and a section have identical names, txp prepends its id to the article URL, even in title_only mode. Otherwise, in yes/no slash modes, there would be no mean to disambiguate. Tweaking it for list mode has some cost, namely because many url schemes can be used in parallel.
Offline
Re: 404 when article_url matches a section name in "Title only". Bug?
Yeah, there’s not much we can do if the title and section are identical, as Oleg says. Best solution is probably to rename the section slightly?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: 404 when article_url matches a section name in "Title only". Bug?
etc wrote #342392:
That’s not exactly a bug, rather a processing simplification. If an article and a section have identical names, txp prepends its id to the article URL, even in
title_onlymode …
Bloke wrote #342393:
Best solution is probably to rename the section slightly?
Okay, thanks for clarifying that. I did, indeed, rename the section :-)
It caught me out shortly before showing a site, and with the clock ticking, I rapidly hand-coded the nav…
TXP Builders – finely-crafted code, design and txp
Offline