Support » Fixing WordPress » “are you sure you want to edit this post” nightmare

  • longtex

    (@longtex)


    This is obviously an on-going problem for a lot of folks. It seems to cut across several releases and a variety of server software, plugins and themes. I think in my case it’s only one theme that I see it in (Suhweet) but I could be wrong about that…

    Now, before you start answering a question I’m not asking, read the following sentence:

    My question is, what piece of code (php, js, whatever) is the source of the text “are you sure you want to edit this post”?

    I’ve looked pretty hard, and haven’t found it yet. If we can find it, we might be able to track it backwards and see what triggers it, and solve the problem that way.

    So… eyeballs on the problem… where does that text appear?

Viewing 10 replies - 1 through 10 (of 10 total)
  • whooami

    (@whooami)

    Member

    I think in my case it’s only one theme that I see it in (Suhweet) but I could be wrong about that…

    Indeed you are, since a theme has nothing to do with the admin area.

    As for your answer — its inside wp-includes/functions.php at line 1257.

    longtex

    (@longtex)

    As far as the theme having nothing to do with the admin area, I don’t know that it’s strictly true. Themes do add options, and for all I know they may modify existing ones as well. The problem seems to be one of timing, since you can almost guarantee the error by writing a post, pausing long enough for it to “autosave” and then trying to save or publish it… pooof! Gone.

    I have several WP blogs on two linux boxes, and I am fairly certain that it is only the one blog that demonstrates this error. However, as I said, if you don’t let it get the the “autosave”, everything’s fine and dandy.

    I don’t suppose you have any insight on how to sh!itcan the autosave feature, do you?

    On my problem blog, I found the line a few minutes before you posted, but on line 1259, not 1257. My wp-includes/functions.php is dated 5/12 at 1737:

    $trans['update']['post'] = array(__('Are you sure you want to edit this post: "%s"?'), 'get_the_title');

    Unfortunately, it’s not much help, yet, as it’s a line that’s just filling in an array of questions. Now… since you found that one so easily… where is that question used?

    I’m looking for trans & update & post, but haven’t found it yet… perhaps I’m looking in the wrong way? I’m heading over to the js functions to look – unfortunately I’m not much of a hand with the linux utils, so I don’t know how to use anything but grep, and that not very well… it would be nice to have something like grep that will recurse subdirs… it might even be grep itself, huh?

    whooami

    (@whooami)

    Member

    you can putz around with removing the code but I think its simpler to just remove wp-includes/js/autosave.js …

    Im guessing thats it, since it looks to be a js call to me.

    longtex

    (@longtex)

    Why characterize attempting to solve a problem as “putzing around”? If you have a non-putzing approach (other than deleting code) I’d love to see it.

    It seems to be a fairly common problem… don’t you think it’s a good idea to solve it, rather than just short-circuiting it? Should I not even attempt to, since it hass a multi-month history of complaints without much in the way of solutions?

    Don’t get me wrong, I’m not against workarounds… but in the long run, it’s more in the nature of problem avoidance rather than problem solving.

    In this particular case, I think I’d like to find a way to add an option to use it or not; “autosave” is not a bad idea, if and when it works – but it seems that javascript has issues with regard to specific installation and usage environments and that some of those issues affect this particular code.

    So… thanks for your help, anyway. I’ll post any solution that I come up with.

    BTW – deleting the code (actually, I renamed it) does work, as far as preventing the “saved” message that pops up next to the save/publish buttons, and is (so far) a 100% indicator that your post will disappear when you try to save or publish it. At least, when I tried it yesterday after finding it as a suggestion (maybe it was yours?) while reading through the list of complaints and solutions (one of which was recopying the js code), I didn’t have any test posts disappear, whereas prior to that I found that if you start editing a new post and stop, wait a minute or two for the “saved at xx:xx:xx” message to appear, your post was a goner.

    whooami

    (@whooami)

    Member

    Why characterize attempting to solve a problem as “putzing around”?

    why be so sensitive? You picked ONE word out of two posts to try and admonish me for?? I use that term quite frequently and meant nothing by it — except to suggest that it might be a time saver.

    Remind me to avoid your threads in the future. Geez.

    longtex

    (@longtex)

    why be so sensitive? You picked ONE word out of two posts to try and admonish me for?? I use that term quite frequently and meant nothing by it — except to suggest that it might be a time saver.

    Remind me to avoid your threads in the future. Geez.

    First, it’s two words, not one. Second, that response was only part of my reply – and I notice you ignored the rest of it.

    It’s not a matter of my being “sensitive” – it’s a matter of your attitude, as indicated by it… and as verified by your followup – it seems you think trying to find out WHY a problem occurs is a waste of time. And if that is indeed how you feel, you’re welcome to stay awaw… ‘S okay by me…

    whooami

    (@whooami)

    Member

    take the chip off your shoulder — I already said I use that phrase/word/WHATEVER all the time and meant NOTHING derogatory by it– I was MERELY offering you a simple solution.

    As for ignoring the rest of your thread — of course I ignored it.. I was too busy defending myself.

    longtex

    (@longtex)

    The chip is in your mind. Forget it.

    FYI: when I first deleted the autosave.js, it looked like that was the key… it appeared to solve the problem. I use “looked like” and “appeared” because it still happens.

    The key =seems= to be that if you start a post, and stop typing for some period of time ( a couple of minutes ) then the magic autosave kicks in, and you will see, just to the left of the “save” and “publish” buttons just below the text box, the words “saved at xx:xx:xx” appear. Some timer is expiring (tinymce?) and kicks off the “save”. Once that happens (on the one blog of ours – the local food co-op), you have screwed the pooch and your post is a goner… the best you can do is copy it and paste it back in and re-set all the other stuff – categories etc.

    In the co-op’s case, the saving has been the use of BlogDesk (or some other client) to write the posts offline and upload them, so there’s no timeout issue… but I tend to go into admin and write… and get interrupted and come back, finish writing, hit “publish” and start slapping my forehead… I’ll bet there’s a blog client for Linux somewhere… gotta go find that, or just test-edit it and paste it in.

    Bottom line: Until we can figure out what it is about the autosave that kills the post, (a) don’t let the the timer expire; if it does, you’ll see “saved at xx:xx:xx” next to the “save” button, and if you see that, COPY THE CONTENT, because it’s not going to get saved; or (b) write the text offline and upload with a client or paste it in.

    Your mileage may vary.

    Billy

    (@billybrasov)

    “are you sure you want to edit this post” what hapend with this bug ? nobody have the solution?

    I have the same problem with WP 2.3.3
    If I click YES, my post is duplicated!!!
    Help!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘“are you sure you want to edit this post” nightmare’ is closed to new replies.