Closed (outdated)
Project:
Page Manager
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
23 Mar 2016 at 20:04 UTC
Updated:
25 Jul 2026 at 01:50 UTC
Jump to comment: Most recent
With \Drupal\Core\Config\Entity\ConfigEntityBase::sort, core seems to be encouraging sorting logic to for config entities to sit within the config entity itself. We currently do our sorting using Page::variantSortHelper.
We could switch over to this pattern by moving Page::variantSortHelper into PageVariant::sort.
We could potentially even use ConfigEntityBase::sort, but that comes with the following caveats:
PageVariant::$weight is required to be public (though we could post a core issue to switch to using $a->get('weight') rather than $a->weight).ConfigEntityBase::sort uses label as a secondary comparison if weights are equal. This may not be desirable.
Comments
Comment #2
andrewbelcher commentedI have left this postponed on #2692397: Adding/removing variants leaves Page::$variants out of date as that will be moving the calls that use this and it'll be simpler to deal with this after that's committed rather than track it.
Comment #3
japerryPage Manager 8.x-1.x is no longer supported, closing.