Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#8096 closed defect (bug) (fixed)

Post preview button points at post editing page

Reported by: johnhennmacc Owned by:
Milestone: Priority: high
Severity: major Version: 2.7
Component: Administration Keywords: reporter-feedback
Focuses: Cc:


While editing a post with a status of draft, the preview button links to the post's editing page instead of the proper preview destination.

Change History (11)

#1 @johnhennmacc
10 years ago

  • Severity changed from normal to major
  • Version set to 2.7

#2 @azaozz
10 years ago

  • Keywords reporter-feedback added

Cannot recreate this. The Preview button/link is JS driven, do you see any JS errors on the page? It should open a new window/tab or reuse the same window if you clicked Preview earlier.

#3 @johnhennmacc
10 years ago

  • Keywords reporter-feedback removed
  • Milestone 2.7 deleted
  • Resolution set to invalid
  • Status changed from new to closed

I think that it went wrong at one point on me, possibly due to a JavaScript error and the URL threw me when I went investigating what happened. I agree that it works now.

#4 @gestroud
10 years ago

  • Keywords preview added
  • Priority changed from normal to high
  • Resolution invalid deleted
  • Status changed from closed to reopened

I updated to version 2.7.2 yesterday and am experiencing the same problem.

This is the url I get when I place my mouse over the Preview button:


There are 49 js errors on the page. They are basically repeats of these messages:

Line:88 Char:1 Code:0 Error:'return' statement outside of function URL:http://westchesterhealthtips.com/wp-admin/post.php?action=edit&post=50&message=6

Line:7 Char:1 Code:0 Error:'null' is null or not an object URL:http://westchesterhealthtips.com/wp-admin/post.php?action=edit&post=58&message=7

This is happening using Internet Explorer 7.

My apologies if I didn't submit this correctly. This is my first time using the bug tracker.

#5 @azaozz
10 years ago

  • Keywords reporter-feedback added; preview removed

Most likely caused by the other js errors. Could you see what the first error is, preferably in Firefox or Opera as they report js errors better.

#6 @DD32
10 years ago

Related to this, but not exactly the same, If you tell the browser to open the link in a background tab (ie. middle click with opera) then it'll load the edit page in the background, since the link points to itself.

In addition, It allways reads "Preview" even after publishing, So, Is it possible to add the Preview URL onto it (even though its handled by JS) and get the title changing for published posts/pages?

#7 @azaozz
10 years ago

The Preview is activated onclick, perhaps Opera doesn't count the middle click as a "real" click... It doesn't change after the post is saved because it's still a preview (showing the latest unsaved changes when editing). Could probably change it to a button so there's no url and any confusion is avoided.

#8 @DD32
10 years ago

The Preview is activated onclick, perhaps Opera doesn't count the middle click as a "real" click..

No, It doesnt, A click to open in background tab is you saying "Open the URL attached to this link in a background tab, do not notify any JS on the link", Its very useful for opening links which have JS attached to them (either a popup on click, or redirections, etc.)

It doesn't change after the post is saved because it's still a preview (showing the latest unsaved changes when editing).

Hm.. I notice the no-JS button does change though, Its "View this Page" or "Preview" depending on if its Published or not, Guess its just a left over? :)

Now that you say that its the latest revision, "Preview" does make sense.

#9 @gestroud
10 years ago

Here are the relevant (I think) js errors that I found in Firefox. The page won't even open in Opera.

Warning: Expected end of value for property but found '#fff'. Error in parsing value for property 'border'. Declaration dropped. Source File: http://westchesterhealthtips.com/wp-admin/post.php?action=edit&post=69 Line: 250

Warning: Selector expected. Ruleset ignored due to bad selector. Source File: http://westchesterhealthtips.com/wp-admin/post.php?action=edit&post=69 Line: 675

Warning: Unexpected end of file while searching for closing } of invalid rule set. Source File: http://westchesterhealthtips.com/wp-admin/post.php?action=edit&post=69 Line: 676

#10 @azaozz
10 years ago

(In [9711]) Preview button: add permalink as a fallback and remove "View Post" when no js, see #8096

#11 @azaozz
9 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Should be fixed now.

Note: See TracTickets for help on using tickets.