Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#31684 closed defect (bug) (fixed)

media.view.Settings.Gallery.extend doesn't work anymore

Reported by: bduclos's profile bduclos Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.2
Component: Media Keywords:
Focuses: javascript Cc:


I use the code below to add custom parameters to galleries. (Jetpack do the same to add a type parameter). Since Trunk split the javascript files into modules, it doesn't work anymore.

media.view.Settings.Gallery = media.view.Settings.Gallery.extend({})

Attachments (1)

31684.diff (146.4 KB) - added by wonderboymusic 9 years ago.

Download all attachments as: .zip

Change History (8)

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

9 years ago

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

9 years ago

#3 @DrewAPicture
9 years ago

  • Keywords dev-feedback added
  • Milestone changed from Awaiting Review to 4.2
  • Owner set to wonderboymusic
  • Priority changed from normal to high
  • Status changed from new to assigned

See also comment:34:ticket:28510.

@wonderboymusic: Could I get you to follow up here please? Looks like there are a couple of reports of issues following the JS modularization in #28510.

#4 @wonderboymusic
9 years ago

Oh man - I will take a hard look and see what is necessary here

9 years ago

#5 @wonderboymusic
9 years ago

In 31935:

Let us pray to the gods of backwards compatibility:

  • The way that the JS modules for media are currently set up turns the existing global namespace into a read-only API, this is bad.
  • For the existing module implementation to work with plugins, those looking to override or extend a class would have to modify their own plugin to use browserify - we can't expect this to happen
  • Because the general way that plugins override media classes is via machete (resetting them to something else), we cannot use require( 'module' ) in the internal code for media modules

We CAN continue to use require( 'fun/js' ) in the manifests for media.

Future code/projects should carefully consider what is made to be public API. In 3.5, EVERYTHING was made public, so everything shall remain public.

See #31684, #28510.

#6 @wonderboymusic
9 years ago

  • Keywords dev-feedback removed
  • Resolution set to fixed
  • Status changed from assigned to closed

Let me know if other problems arise, please.

#7 @DrewAPicture
9 years ago

  • Priority changed from high to normal
Note: See TracTickets for help on using tickets.