#6110 closed defect (bug) (wontfix)
Custom permalinks created from plugin hooking in to WP redirects don't work.
Reported by: | nerrad | Owned by: | |
---|---|---|---|
Milestone: | Priority: | high | |
Severity: | major | Version: | 2.5 |
Component: | Permalinks | Keywords: | |
Focuses: | Cc: |
Description
This might be related to ticket #5995:
I've been testing the new version of my Organize Series Plugin which works fine in WP 2.3.x with the redirect hooks. However in 2.5 none of the plugin specific redirects work.
To be clearer:
In 2.3.x http://localhost/series/series-name would redirect properly to the "series" archive page.
After upgrading to 2.5 http://localhost/series/series-name returns 404 error.
I've tried regenning permalinks, but that doesn't fix the problem. Is there something that's changed with how plugins should be hooking into the permalink system in 2.5?
Attachments (2)
Change History (26)
#3
@
16 years ago
See attached file DD32 that contains the code. Again, I have no problems with WP2.3.3 but for some reason I get problems with 2.5
#4
@
16 years ago
I should also say that without permalinks (i.e. the default http://path/index.php?param=) everything works as expected. But as soon as I flip to permalinks my series archive pages return 404 BUT all other pages and posts work as expected.
#5
@
16 years ago
Hm......... I cant reproduce the problem your having:
http://dd32.no-ip.com:8080/wordpress/series/test-series/
using the plugin from here: http://www.unfoldingneurons.com/2008/organize-series-20-beta-1-release
I'm using the Permalink structure: /%year%/%monthnum%/%day%/%postname%/ I can see if using something like /%category%/%postname%/ could cause a 404 maybe..
Feel free to contact me off list @ wordpress@… if you want me to try more things, or to know more about my environment.. BTW, I had to make a change to part of the code to suppress some errors:
series-taxonomy.php Line 36: From: if (array_key_exists('object_id', $spost)) { To: if ( is_array($spost) && array_key_exists('object_id', $spost)) {
$spost was an Integer, which was throwing a Warning(If errors are turned on) Change it to:
if ( (is_array($spost) || is_object($spost) ) && array_key_exists('object_id', $spost)) {
if you accept an object there too..
#6
@
16 years ago
Thanks for the bugcatch - I just caught that myself this morning and used a different fix :)
Thanks for your offer to help to - I've sent off an email.
#7
@
16 years ago
A thought - maybe this could point in the right direction. Are there any changes to the core rewrite rule-sets (from 2.3.3 - 2.5) that "might" make one more greedy and thus snag my plugin redirect before it get's processed (my plugin redirect just appends to the redirect array)?
#8
@
16 years ago
It'd be due to the verbose page rules which were introduced.
Silly me didnt realise that i had a patch applied still which added the verbose page rules AFTER the hook that plugins add pages on.
I'll attach a patch of the change i had made, Its probably hanging around in a previous trac ticket somewhere too.
#9
@
16 years ago
A Work around is to add the plugins rules at the start of the array:
$rules = current rules $rewrite = plugin generated rules return ( $rewrite + $rules ); rather than: return ( $rules + $rewrite );
But that requires WordPress to check those rules first, While not a problem specifically, a lot of plugins are setup to add rules to the end of the list, rather than the start
#10
@
16 years ago
DD32;
I tried the workaround - it doesn't work. Stumped again. It's as if the 'rewrite_rules_array' filter isn't doing anything.
#11
@
16 years ago
it doesn't work. Stumped again
So am i then.. Hopefully someone else can help more, 'cos i'm stumpted.
(You did try re-generating the rules didnt you?)
#13
@
16 years ago
Okay something strange just happened - it started working. So...it looks like the workaround DOES work. I've confirmed it. (might have been a cacheing thing with my browser or something).
#14
@
16 years ago
I still think this warrants attention for 2.5 however. Your patch would do the trick and prevent potential headaches for plugins that do redirects...
#15
@
16 years ago
Here is another plugin that was affected: YADIS
http://svn.wp-plugins.org/yadis/tags/1.2.1/yadis.php
This is with Wordpress 2.5 released.
Ciao!
#17
@
15 years ago
- Component changed from General to Permalinks
- Owner changed from anonymous to ryan
#18
@
15 years ago
Pretty sure this is.. well.. a wontfix ticket now.. However the patch does look useful (Add the greedy rules definately at the end of the rule list)
Could come undone by any plugins which add extra-hungry rules at the end of the list.. But they've been broken since the greedy rules were introduced.
#20
@
14 years ago
- Milestone changed from 3.0 to Future Release
- Owner changed from ryan to dd32
- Status changed from new to reviewing
Moving to future release due to no traction.
Will review this after release.
Can you link to the plugin, Or provide some code of whats not working?
This code is still working for me: http://dd32.id.au/files/wordpress/test-rewrite.php But i admit some things in there dont use the WP API.