WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 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:

Description

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)

comment:1 johnhennmacc6 years ago

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

comment:2 azaozz6 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.

comment:3 johnhennmacc6 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.

comment:4 gestroud6 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:

http://westchesterhealthtips.com/wp-admin/post.php?action=edit&post=58&message=7#

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.

comment:5 azaozz6 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.

comment:6 DD326 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?

comment:7 azaozz6 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.

comment:8 DD326 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.

comment:9 gestroud6 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

comment:10 azaozz6 years ago

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

comment:11 azaozz6 years ago

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

Should be fixed now.

Note: See TracTickets for help on using tickets.