Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#39559 closed defect (bug) (fixed)

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

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

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 10 years ago.

Download all attachments as: .zip

Change History (5)

#1 @adamsilverstein
10 years ago

  • Owner set to adamsilverstein
  • Status new → assigned

#2 @adamsilverstein
10 years ago

  • Summary REST API: JavaScript Client - Ensure base initialize method called when subclassing WPApiBaseModel → 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.


10 years ago

#4 @adamsilverstein
10 years ago

  • Keywords has-patch needs-unit-tests removed
  • Resolution → fixed
  • Status assigned → 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.