Opened 17 years ago
Closed 17 years ago
#10181 closed defect (bug) (fixed)
Warnings after post/page save
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.8.1 | Priority: | normal |
| Severity: | blocker | Version: | 2.8 |
| Component: | Autosave | Keywords: | has-patch needs-testing |
| Focuses: | Cc: |
Description
Inside the autosave box and after I save/publish a post or page, I get the following:
Warning: fopen(/var/www/hosted/finalgear.com/htdocs/.htaccess) [function.fopen]: failed to open stream: Operation not permitted in /var/www/hosted/finalgear.com/htdocs/wordpress/wp-admin/includes/misc.php on line 75 Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/hosted/finalgear.com/htdocs/wordpress/wp-admin/includes/misc.php on line 84
The second error message is repeated a few dozen times. Looks like it's trying to write to the .htaccess file every single time something is saved (which doesn't make sense).
Regardless, attached patch should silence the errors.
Attachments (2)
Change History (10)
#4
@
17 years ago
posting the IRC logs for reference:
1:31 AM ddebernardy
I think there are two issues
1:31 AM Viper007Bond
there are
1:31 AM ddebernardy
one is we don't check that it's writable
1:31 AM Viper007Bond
(it is)
1:31 AM ddebernardy
the is_writable check is different for IIS and apache, but we can manage that
1:31 AM Viper007Bond
i'm on apache
1:31 AM
the file is 777
1:31 AM ddebernardy
the other is that we're trying to do this a dozen times, and that definitely isn't normal
1:32 AM Viper007Bond
one write per line or something
1:32 AM
foreach ( $markerdata as $n => $markerline ) {
1:32 AM
oh, wait, maybe not
1:32 AM
hmm
1:33 AM ddebernardy
nah, I'd think it's related to do_action(save_post) et al being called multiple times (once per post, and once per autosave, and once per revision, etc, and possibly more than once each
1:33 AM Viper007Bond
save_mod_rewrite_rules() is getting called too often
1:34 AM
infact it doesn't even need to be called at all when you save a post
1:34 AM
not since like 2.0.x
1:34 AM ddebernardy
it used to, when the rules were all in the htaccess file
1:34 AM Viper007Bond
yep
1:34 AM ddebernardy
but indeed, now they don't, we merely need to update the option thingy
1:35 AM
even then, though, we need to make sure it only ever gets called once when needed
#5
@
17 years ago
- Keywords needs-patch added; has-patch removed
1:45 AM rboren We need a soft flush_rules() for use on page updates. 1:45 AM rboren No writing to .htaccess unles verbose page rules are on.
Note: See
TracTickets for help on using
tickets.
Rather than silencing it, we'd better nail down why it's writing it so many times.
The warning comes on IIS or apache?