Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#39559 closed defect (bug) (fixed)

REST API JavaScript client: ensure base initialize method called when subclassing WPApiBaseModel

Reported by: adamsilverstein's profile adamsilverstein Owned by: adamsilverstein's profile adamsilverstein
Milestone: 4.7.3 Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords:
Focuses: javascript Cc:

Description

This ensures that plugins which wrap the base initialize method will ensure it always will get called. See for example https://github.com/xwp/wp-customize-rest-resources/blob/456308e28a1b495417ca70f30c9da9b630b9ba07/js/rest-resources-manager.js#L49-L57

From @westonruter, see https://github.com/WP-API/client-js/pull/151

Attachments (1)

39559.diff (494 bytes) - added by adamsilverstein 8 years ago.

Download all attachments as: .zip

Change History (5)

#1 @adamsilverstein
8 years ago

  • Owner set to adamsilverstein
  • Status changed from new to assigned

#2 @adamsilverstein
8 years ago

  • Summary changed from REST API: JavaScript Client - Ensure base initialize method called when subclassing WPApiBaseModel to REST API JavaScript client: ensure base initialize method called when subclassing WPApiBaseModel

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


8 years ago

#4 @adamsilverstein
8 years ago

  • Keywords has-patch needs-unit-tests removed
  • Resolution set to fixed
  • Status changed from assigned to closed

The one line fix in 39559.diff was also included in the fix for #39561, which was merged in [40074], resolving this issue. Closing.

Note: See TracTickets for help on using tickets.