Issue #3107130 by PCate, kishor_kolekar, ravi.shankar, Vidushi Mehta, rajneeshb, Kristen Pol, thalles, quietone, alexpott: Responsive image field formatter list should be sorted by label, not machine name

(cherry picked from commit baa711c9fe)
merge-requests/674/head
Lee Rowlands 2021-05-14 11:40:51 +10:00
parent 271bc1c027
commit 7cff929a42
No known key found for this signature in database
GPG Key ID: 2B829A3DF9204DC4
1 changed files with 1 additions and 0 deletions

View File

@ -127,6 +127,7 @@ class ResponsiveImageFormatter extends ImageFormatterBase {
public function settingsForm(array $form, FormStateInterface $form_state) {
$responsive_image_options = [];
$responsive_image_styles = $this->responsiveImageStyleStorage->loadMultiple();
uasort($responsive_image_styles, '\Drupal\responsive_image\Entity\ResponsiveImageStyle::sort');
if ($responsive_image_styles && !empty($responsive_image_styles)) {
foreach ($responsive_image_styles as $machine_name => $responsive_image_style) {
if ($responsive_image_style->hasImageStyleMappings()) {