Ticket #7437 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

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

Reported by: Viper007Bond Assigned to: anonymous
Priority: high Milestone: 2.6.1
Component: Administration Version: 2.6
Severity: normal Keywords: has-patch
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

7437.patch (0.6 kB) - added by Viper007Bond on 07/30/08 08:50:55.

Change History

07/30/08 08:50:55 changed by Viper007Bond

  • attachment 7437.patch added.

07/30/08 08:51:37 changed by Viper007Bond

  • milestone changed from 2.6.1 to 2.7.

Suggest it be backported to 2.6.1.

07/30/08 09:18:59 changed by azaozz

  • status changed from new to closed.
  • resolution set to fixed.

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

07/30/08 09:19:33 changed by azaozz

  • status changed from closed to reopened.
  • resolution deleted.
  • milestone changed from 2.7 to 2.6.1.

Re-open for 2.6.1

07/30/08 09:20:45 changed by azaozz

  • status changed from reopened to closed.
  • resolution set to fixed.

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

07/30/08 09:39:22 changed by DD32

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?

07/30/08 11:15:25 changed by Viper007Bond

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.

(follow-up: ↓ 8 ) 07/30/08 11:29:38 changed by DD32

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.

(in reply to: ↑ 7 ) 07/30/08 11:43:05 changed by Viper007Bond

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.

07/30/08 12:32:05 changed by azaozz

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

07/30/08 12:33:29 changed by azaozz

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

(follow-up: ↓ 12 ) 07/30/08 12:42:18 changed by 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

(in reply to: ↑ 11 ) 07/30/08 12:48:43 changed by azaozz

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.