Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#4737 closed defect (bug) (fixed)

Attempting to edit post/page that doesn't exist doesn't generate an error message

Reported by: Viper007Bond Owned by:
Milestone: 2.3 Priority: lowest
Severity: minor Version: 2.3
Component: Administration Keywords: has-patch commit
Focuses: Cc:


post.php?action=edit&post=X (and it's page counterpart) doesn't check the entered ID to see if it exists. If a user edits the URL (or more likely bookmarks the URL for later editing) but the post ID doesn't exist (say it's deleted after bookmark), no pretty error message is displayed.

Instead, a blank edit form is displayed (such as the Write post screen) and on the edit post page, following error is displayed:

Warning: Attempt to assign property of non-object in [...]/wp-admin/edit-form-advanced.php on line 49

(for obvious reasons)

A simple fix is attached that should do the job.

Attachments (3)

checkid.patch (1.0 KB) - added by Viper007Bond 11 years ago.
checkid2.patch (1.1 KB) - added by Viper007Bond 11 years ago.
Better L10n support?
checkid2a.patch (1.0 KB) - added by Viper007Bond 11 years ago.
Less technical error message

Download all attachments as: .zip

Change History (6)

11 years ago

Better L10n support?

#1 @Viper007Bond
11 years ago

  • Keywords 2nd-opinion added

11 years ago

Less technical error message

#2 @Nazgul
11 years ago

  • Keywords commit added; 2nd-opinion removed

#3 @ryan
11 years ago

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

(In [5875]) Display error message when attempting to edit post or page IDs that do not exist. Props Viper007Bond. fixes #4737

Note: See TracTickets for help on using tickets.