Activity log for bug #343821

Date Who What changed Old value New value Message
2009-03-16 19:01:40 Paul Nus bug added bug
2009-03-16 23:31:18 Alex Stansfield wordpress-csd: status New Confirmed
2009-03-16 23:31:18 Alex Stansfield wordpress-csd: assignee casualgenius
2009-03-16 23:31:18 Alex Stansfield wordpress-csd: statusexplanation Many thanks for being the first to use the bug tracker. I've looked at the page and can confirm the error. Can you send me what permalinks you're using, version of the plugin and version of wordpress.
2009-03-17 05:16:38 Alex Stansfield wordpress-csd: status Confirmed In Progress
2009-03-17 05:16:38 Alex Stansfield wordpress-csd: importance Undecided High
2009-03-17 05:16:38 Alex Stansfield wordpress-csd: statusexplanation Many thanks for being the first to use the bug tracker. I've looked at the page and can confirm the error. Can you send me what permalinks you're using, version of the plugin and version of wordpress. Hi Paul, I've replicated and, hopefully, fixed this bug. I'm a little worried about knock on problems as it required a change to the rewrite rules which are basically a kind of voodoo magic. If you wish to test it out then edit the plugin/filters.php file. Find the function "wps_post_rewrite_rules" and replace it with the one below. function wps_post_rewrite_rules( $rules ) { global $wps_this_subdomain, $wp_rewrite; // If we have %category% in the permalink we also need to create rules without it. // This is because the category might be the subdomain and so wouldn't be in the url if ( strstr( $wp_rewrite->permalink_structure, '%category%' ) && $wps_this_subdomain && ($wps_this_subdomain->type == WPS_TYPE_CAT) ) { // Grab the permalink structure $perma_tmp = $wp_rewrite->permalink_structure; // Remove the /%category section $perma_tmp = str_replace('/%category%','',$perma_tmp); // Create the extra rules using this new structure $extra_rules = $wp_rewrite->generate_rewrite_rules($perma_tmp, EP_PERMALINK); // Now we have to remove the rule that matches a category on it's own // this is reinstated later but just can't come before the extra rules $unset_key = array_search('index.php?category_name=$matches[1]', $extra_rules); if ($unset_key) { unset($extra_rules[$unset_key]); } // Check for the problem attachment rules and remove them. // Pray this doesn't break anything ;) foreach ($extra_rules as $regexp => $url) { if (strpos($url, 'attachment=$matches') && (strpos($regexp, 'attachment') === false)) { unset($extra_rules[$regexp]); } } // merge to two rule sets into one $rules = array_merge($extra_rules, $rules); } // Check if the permalink structure has any date parts $has_date = false; foreach ( array( '%year%', '%monthnum%', '%day%' ) as $datepart ) { if ( strstr( $wp_rewrite->permalink_structure, $datepart ) ) { $has_date = true; } } // If there is a date part in the permalink structure filter by the subdomain we're on // This is incase we're actually looking at an date archive rather than a post if ( $has_date && $wps_this_subdomain) { $rules = $wps_this_subdomain->addRewriteFilter($rules); } //print('<pre>'.print_r($rules,true).'</pre>'); return $rules; } Let me know how you get on and if you notice anything else go wrong. If it's ok for you I will release an 0.6.1-rc2 with the fix and see if anyone else find issues with it. Cheers, Alex
2009-04-05 14:28:32 Alex Stansfield wordpress-csd: status In Progress Fix Released