Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#30219 closed defect (bug) (fixed)

Revisions modules should not rely on global settings

Reported by: ericlewis Owned by: wonderboymusic
Priority: normal Milestone: 4.1
Component: Revisions Version:
Severity: normal Keywords: has-patch commit
Cc: Focuses: javascript

Description

Some revisions Backbone modules currently depend on the global settings object (_wpRevisionsSettings).

Here's an example.

This is an anti-pattern and tends to make these modules non-reusable.

Attachments (2)

30219.diff (1.9 KB ) - added by ericlewis 12 years ago.
30219.2.diff (3.9 KB ) - added by ericlewis 12 years ago.

Download all attachments as: .zip

Change History (7)

@ericlewis
12 years ago

#1 @ericlewis
12 years ago

  • Keywords has-patch added

In attachment:30219.diff, move globally referenced initial state for wp.revisions.model.FrameState to initializing attributes hash.

#2 @ericlewis
12 years ago

  • Keywords commit added
  • Milestone Awaiting Review4.1

@ericlewis
12 years ago

#3 @ericlewis
12 years ago

attachment:30219.2.diff supercedes attachment:30219.diff and removes all dependence on global settings.

#4 @wonderboymusic
12 years ago

  • Owner set to wonderboymusic
  • Resolutionfixed
  • Status newclosed

In 30131:

Revisions modules should not rely on global settings:

  • Only pass in global settings on init, this allows the classes to be used agnostically elsewhere
  • Clean up some erroneous/weird Backbone syntax

Props ericlewis, wonderboymusic.
Fixes #30219.

#5 @ocean90
12 years ago

Follow-up: #30672

Note: See TracTickets for help on using tickets.