WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12954 closed defect (bug) (duplicate)

Javascript error upon updating scheduling date

Reported by: dd32 Owned by: azaozz
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: JavaScript Keywords:
Focuses: Cc:

Description

Schedule a post for publish at a later date, Click OK, Save the post.

Edit the scheduling on the post to a future date(note: previous date not affected), attempt to click OK, experience a JS error

Error:

JavaScript - http://localhost/wordpress-commit/wp-admin/post.php?post=438&action=edit

Uncaught exception: ReferenceError: Undefined variable: page
Error thrown at line 388, column 4 in updateText() in http://localhost/wordpress-commit/wp-admin/js/post.dev.js?ver=20100403:
    if ( page )
called from line 510, column 3 in <anonymous function>() in http://localhost/wordpress-commit/wp-admin/js/post.dev.js?ver=20100403:
    if ( updateText() )
called via Function.prototype.apply() from line 55, column 294 in <anonymous function: handle>(a) in http://localhost/wordpress-commit/wp-includes/js/jquery/jquery.js?ver=1.4.2:
    i=i.handler.apply(this,arguments);
called via Function.prototype.apply() from line 49, column 569 in <anonymous function: o>() in http://localhost/wordpress-commit/wp-includes/js/jquery/jquery.js?ver=1.4.2:
    return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w

Code in question:

				if ( page )
					$('#publish').val( postL10n.updatePage );
				else
					$('#publish').val( postL10n.updatePost );

page is referenced twice in the same format, I cant see anywhere in the file its mentioned.

Attachments (1)

post_type_page.diff (641 bytes) - added by harry.nguyen 4 years ago.

Download all attachments as: .zip

Change History (6)

harry.nguyen4 years ago

comment:1 harry.nguyen4 years ago

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

Hi,

updateText function() tried to distinguish between page and post; however, 'page' variable was not defined properly. Fixed.

comment:2 nacin4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:3 follow-up: ocean904 years ago

Similar to #12829, #12834 and #12928

comment:4 in reply to: ↑ 3 duck_4 years ago

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

Replying to ocean90:

Similar to #12829, #12834 and #12928

comment:5 nacin4 years ago

  • Milestone 3.0 deleted
Note: See TracTickets for help on using tickets.