Problem/Motivation

#2659940: Extension System, Part III: ThemeExtensionList and ThemeEngineExtensionList introduced a weight public property on Themes' extension objects. There was no discussion and we still have comments like

// The value is not used; the weight is ignored for themes currently.

and runtime code like

      // Set the actual theme weights.
      $theme_list = array_map(function ($theme) use ($theme_data) {
        return $theme_data[$theme]->sort;
      }, $theme_list);

      // Sort the theme list by their weights (reverse).
      arsort($theme_list);
      $theme_list = array_keys($theme_list);

Proposed resolution

Remove the weight property because it is confusing and unnecessary.

This need to be done before 8.7.0 otherwise it is anAPI change.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
FileSize
677 bytes

Status: Needs review » Needs work

The last submitted patch, 2: 3016968-2.patch, failed testing. View results

alexpott’s picture

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +DX (Developer Experience), +API clean-up

Nice clean-up; looks good to me. Adding tags and queueing the tests on additional backends. RTBC once everything is green.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 9effdc6 and pushed to 8.7.x. Thanks!

  • catch committed ad90262 on 8.7.x
    Issue #3016968 by alexpott: Remove weight public property from theme...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.