Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Topic closed
Problem: rss_superarchive 0.18 and clean URLs
Over in this thread, I (and others) have reported a problem with clean URLs under TXP 4.0.4, whereby URLs of the form /section/id bring up the default page for the section, and you must use /section/id/title to get the actual article. I just disabled rss_superarchive 0.18, which is the only plugin I was using, and the problem immediately went away.
Rob, if you’re listening, would you please check this out? I would love to be able to reactivate the plugin — fortunately it is only affecting a single page on my site, but it’s an important page.
Offline
Re: Problem: rss_superarchive 0.18 and clean URLs
Try editing the plugin and change this line in the rss_suparchive_init() function:
if ($u2 && is_numeric($u2)) $_POST['s'] = $u1;
into:
if (!$u3 and $u2 and is_numeric($u2)) $_POST['s'] = $u1;
Or, if that doesn’t work, change the order of these two lines (swap them):
if ($u2 && is_numeric($u2)) $_POST['s'] = $u1;
if (($u3 && !is_numeric($u3)) || (!$attach_titles_to_permalinks && !$u3)) $_POST['id'] = $u2;
If I remember correctly, rss_sup_archive also broke /section/category style urls, so perhaps even better would be:
if ($u2 and is_numeric($u2)) {
if (!$u3) {
if (!$attach_titles_to_permalinks) $_POST['id'] = $u2;
else $_POST['s'] = $u1;
}
elseif (!is_numeric($u3)) POST['id'] = $u2;
}
… but it’s hard to tell for sure without knowing what type of URLs rss_suparchive tries to handle.
Last edited by ruud (2006-11-21 09:08:20)
Offline
#3 2006-11-21 10:13:36
- -jw-
- Member

- From: fruitbelly, the Netherlands
- Registered: 2004-03-16
- Posts: 79
Re: Problem: rss_superarchive 0.18 and clean URLs
Same thing seems to happen with rss_unlimited_categories. At least with me. /section/id/title brings up the section page. just /title serves a 404. Alle other clean url schemes seem to work correct with the plugin ennabled.
All clean url schemes work with de rss_unlimited_categories (v0.5) plugin disabled, work correct.
I didn’t look back after choosing a scheme that just worked. This post brought it all back.
Just occured that I haven’t looked for a new version of this plugin. So maybe it is already fixed.
textile deletes my identity
Offline
Re: Problem: rss_superarchive 0.18 and clean URLs
I don’t have time at the moment to try hacking rss_superachive, I will wait for Rob to take a look. In the meantime, I tried going back to version 0.16 and then 0.15, but the problem is still present with these versions.
Offline
Re: Problem: rss_superarchive 0.18 and clean URLs
I really hope that Rob will take a look at this. I sent him a message through his site as well (back before Thanksgiving) but have heard nothing, and there’s no indication on his blog that he’s even aware of the issue. I’ve had to resort to doing a one-time rendering of the page on which I use rss_superarchive (to create a site index) and publishing the output as a static page so that the rest of the site will work properly, but really, I would love to be able to re-enable the plugin.
Offline
Re: Problem: rss_superarchive 0.18 and clean URLs
I have taken a look at the issues and someone can correct me if I’m wrong, but unless you select no for the Attach titles to permalinks? preference, /section/id is not a valid URL mode in Textpattern. That is why the plugin causes a “bug” when you try to resolve that URL.
The plugin was built to parse URLs in order to support /section/year/month archives. Therefore, when the second part of the URL is a number and there is not third part to the URL, the plugin assumes that the number is a year if you are configured to attach titles to permlinks.
My question is, if you have not turned that preference off, how are you generating /section/id URLs?
Offline
Re: Problem: rss_superarchive 0.18 and clean URLs
I should be able to prevent this from happening most of the time, but not all. I would still have no way of knowing whether a number like 2006 was a year or an article ID.
I can add this fix, but the question still stands as to how the /section/id URLs are being generated.
Offline
Re: Problem: rss_superarchive 0.18 and clean URLs
Thanks for taking a look.
Good question; I was not even aware of that setting, but I don’t completely understand what it does.
I’ve been doing nothing to generate these URLs; rather, I discovered shortly after starting to use TXP that I could leave off the title part of a /section/id/title URL, and it would still point to the correct item, which is very handy as it provides a quasi-TinyURL-like way of referring to the article. Now, maybe this is an unintended/undocumented “feature”, but I would argue that it is a very useful one (especially when emailing links or posting them to plain-text mailing lists), and I have been able to use it consistently through several TXP and rss_superarchive versions — until 4.0.4 came out. I would also argue that since /section/id URLs work without the plugin (i.e., in plain-vanilla TXP), that they should either continue to work with the plugin enabled, or else the plugin should document that it changes TXP’s behavior in this respect.
Would you consider adding a flag to the plugin that would allow this clean-URL variant to continue working?
Last edited by DaveSeidel (2006-12-03 16:51:27)
Offline
Re: Problem: rss_superarchive 0.18 and clean URLs
Some say undocumented feature, some say bug ;) If you like the result its the former, if you don’t its the latter.
The Attach titles to permalinks? preference determines whether TXP will attach the url_title to the URL. So if you set that to no you would get a URL in the format /article/1 rather than the standard /article/1/first-post. To me, only URLs that are automatically generated by TXP are valid and therefore valid for plugins to support.
In either case, I can add code to support URLs without the url_title attached, but that would break the archive functionality on years that matched article IDs.
Another question to you…do you use the date filtered archive functionality of the plugin?
Offline
Re: Problem: rss_superarchive 0.18 and clean URLs
Rob, thanks for your help. It turns out that the Attach titles to permalinks? setting does precisely what I want, and allows your plugin to also work as designed. I now get generated links of the form /section/id, but link of the form /section/id/title still work fine (which is important since one of the blogs I administer has a huge number of title-containing links that are already indexed in search engines and mailing list archives. I feel slightly sheepish that I didn’t know about this setting, but that’s the way it goes.
To answer your question, here’s how I use the plugin:
<h3>All Articles By Date</h3>
<txp:rss_suparchive showsubdate=“1” dateformat=”%F %Y” section=“article,archives” />
<h3>All Articles By Subject</h3><br/>
<txp:rss_suparchive_bycat section=“article,archives” showdate=“1” />
which results in this page. This is literally the only place I currently use the plugin, but it generates an important part of the site.
So, from my POV, this resolves the issue. Unless this solution is insufficient for someone else, I don’t see any reason for you to change any of your code. Thanks for educating me, and thanks for all your plugin work.
Offline
Re: Problem: rss_superarchive 0.18 and clean URLs
Sounds good Dave.
Not sure if you use it, but the date filtering I referred to allows you to generate a page that shows only articles within a given year, month or day. For example your posts from November 2006 or your posts from 2005.
If anyone else feels that this is still a problem, I can release the fix I have. But again, I think its incomplete when dealing with a case where a year matches an article ID.
Offline
Re: Problem: rss_superarchive 0.18 and clean URLs
wilshire wrote:
Not sure if you use it, but the date filtering I referred to allows you to generate a page that shows only articles within a given year, month or day. For example your posts from November 2006 or your posts from 2005.
Cool, that’s good to know about.
Offline
Pages: 1
Topic closed