Make WordPress Core

Opened 16 years ago

Closed 13 years ago

Last modified 13 years ago

#16096 closed defect (bug) (wontfix)

editing permalink structure in edit site causes 404s on site

Reported by: wpmuguru Owned by:
Priority: normal Milestone:
Component: Network Admin Version: 3.1
Severity: normal Keywords: has-patch
Cc: Focuses: multisite

Description

If you edit a sites permalink structure in the network admin edit site screen, the site's rewrite rules do not get updated. The permalink_structure option is used to generate the permalinks on the front end of the site. Hence the rewrite rules will not match the permalinks until the permalink settings screen is visited in the site's dashboard.

The two alternatives are remove the permalink setting from the edit site screen or clear the rewrite rules.

I'm attaching a patch to clear the rewrite rules. The patch uses update_option instead of delete_option because update_option leaves the empty option in the object cache. If the option is deleted then WP will query the DB, add rewrite_rules to the notoptions cache, generate the rules, update the DB & remove rewrite_rules from the notoptions cache.

Attachments (2)

16096.diff (457 bytes ) - added by wpmuguru 16 years ago.
16096-2.diff (371 bytes ) - added by greuben 16 years ago.

Download all attachments as: .zip

Change History (14)

@wpmuguru
16 years ago

#1 @westi
16 years ago

  • Milestone Awaiting Review3.1
  • Version3.1

Is this a regression?

#2 follow-up: @greuben
16 years ago

I don't think its a regression. Instead of update_option, we can use flush_rewrite_rules?

@greuben
16 years ago

#3 @ryan
16 years ago

Patches seem fine, but we're very close to release and this is not a regression. Suggesting punt to 3.2.

#4 @wpmuguru
16 years ago

In 3.0 it had delete_option & I've explained why I used update_option instead.

https://core.trac.wordpress.org/browser/branches/3.0/wp-admin/ms-edit.php#L252

#5 @wpmuguru
16 years ago

Was added to 3.0 for #12383

#6 follow-up: @nacin
16 years ago

  • Keywords punt added

Editing the permalink structure here should be a YMMV situation.

#7 @ryan
16 years ago

The same is true of wp-admin/options.php.

#8 @nacin
16 years ago

  • Milestone 3.1Future Release

#9 in reply to: ↑ 2 @wpmuguru
16 years ago

Replying to greuben:

I don't think its a regression. Instead of update_option, we can use flush_rewrite_rules?

No, you cannot flush rewrite rules while switched.

#10 @SergeyBiryukov
14 years ago

  • Keywords punt removed

#11 in reply to: ↑ 6 @jeremyfelt
13 years ago

  • Keywords has-patch removed
  • Milestone Future Release
  • Resolutionwontfix
  • Status newclosed

Closing this as wontfix based on time lapsed after comments from nacin:

Editing the permalink structure here should be a YMMV situation.

and from ryan:

The same is true of wp-admin/options.php

#12 @SergeyBiryukov
13 years ago

  • Keywords has-patch added
Note: See TracTickets for help on using tickets.