WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#30219 closed defect (bug) (fixed)

Revisions modules should not rely on global settings

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

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 7 years ago.
30219.2.diff (3.9 KB) - added by ericlewis 7 years ago.

Download all attachments as: .zip

Change History (7)

@ericlewis
7 years ago

#1 @ericlewis
7 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
7 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 4.1

@ericlewis
7 years ago

#3 @ericlewis
7 years ago

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

#4 @wonderboymusic
7 years ago

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

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
6 years ago

Follow-up: #30672

Note: See TracTickets for help on using tickets.