WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#7437 closed defect (bug) (fixed)

When restoring a Page revision, a blank success message is shown

Reported by: Viper007Bond Owned by:
Milestone: 2.6.1 Priority: high
Severity: normal Version: 2.6
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

If you restore a Page revision, the yellow success box at the top is empty. This is because the message is missing.

Attachments (1)

7437.patch (625 bytes) - added by Viper007Bond 7 years ago.

Download all attachments as: .zip

Change History (13)

@Viper007Bond7 years ago

comment:1 @Viper007Bond7 years ago

  • Milestone changed from 2.6.1 to 2.7

Suggest it be backported to 2.6.1.

comment:2 @azaozz7 years ago

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

(In [8506]) Add "Page restored" message. Props Viper007Bond, fixes #7437 for 2.7

comment:3 @azaozz7 years ago

  • Milestone changed from 2.7 to 2.6.1
  • Resolution fixed deleted
  • Status changed from closed to reopened

Re-open for 2.6.1

comment:4 @azaozz7 years ago

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

(In [8507]) Add "Page restored" message. Props Viper007Bond, fixes #7437 for 2.6.1

comment:5 @DD327 years ago

Just a quick thought: just using $_GETrevision? could cause a undefined index warning, also means its calling for the revision title regardless.. It could be added to an if(isset($_GETrevision?)) or similar?

comment:6 @Viper007Bond7 years ago

DD32: I just copy/pasted from the post version, but yeah it would cause an undefined index if you messed with the URL. However if you use a clean install of ?WordPress, it should be impossible to get such an error as WP always passes it.

Not sure if it's worth the trouble or not to protect against a warning caused by a manual URL creation.

comment:7 follow-up: @DD327 years ago

if you messed with the URL.

My thought is that that page is loaded on urls that do not include ?revision=123 etc, which would cause it.

I've seen notice level errors poping up on some dev severs where by default its set to show notice errors, AFAIK some effort is made to avoid non-set array items such as notices judging by the other tickets which get commited to remove them.

comment:8 in reply to: ↑ 7 @Viper007Bond7 years ago

Replying to DD32:

My thought is that that page is loaded on urls that do not include ?revision=123 etc, which would cause it.

Oh, right, that wp_post_revision_title() gets called on every single page load. We should wrap the whole thing in a $_GET['message'] conditional.

comment:9 @azaozz7 years ago

(In [8508]) Stop PHP warnings when $_GET[revision] is not set. Props DD32, see #7437

comment:10 @azaozz7 years ago

(In [8509]) Stop PHP warnings when $_GET[revision] is not set. Props DD32, see #7437, for 2.6

comment:11 follow-up: @Viper007Bond7 years ago

Not that it really matters, but if $_GET['revision'] is not set is not set but $_GET['message'] == 5, then a blank yellow box will be shown again. :P

comment:12 in reply to: ↑ 11 @azaozz7 years ago

Replying to Viper007Bond:

Not that it really matters, but if $_GET['revision'] is not set is not set but $_GET['message'] == 5, then a blank yellow box will be shown again. :P

Yes, however message[5] is only shown after restoring revision, and $_GET[revision] is always set then, no way to restore it otherwise.

Note: See TracTickets for help on using tickets.