From f6bf32de01331bf584bf888f43deead829151ab3 Mon Sep 17 00:00:00 2001 From: Pavel Dohnal Date: Thu, 13 Sep 2018 09:46:37 +0200 Subject: [PATCH] Ensure the right order [MAILPOET-1480] --- lib/API/JSON/v1/NewsletterTemplates.php | 3 +- lib/Config/Populator.php | 41 +++++++++++++------------ 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/lib/API/JSON/v1/NewsletterTemplates.php b/lib/API/JSON/v1/NewsletterTemplates.php index f0bd823b12..371d8e6fcd 100644 --- a/lib/API/JSON/v1/NewsletterTemplates.php +++ b/lib/API/JSON/v1/NewsletterTemplates.php @@ -31,8 +31,9 @@ class NewsletterTemplates extends APIEndpoint { function getAll() { $collection = NewsletterTemplate ::selectExpr('id, categories, thumbnail, name, description, readonly') + ->orderByAsc('readonly') ->orderByDesc('created_at') - ->orderByAsc('name') + ->orderByDesc('id') ->findMany(); $templates = array_map(function($item) { return $item->asArray(); diff --git a/lib/Config/Populator.php b/lib/Config/Populator.php index c84d8245e4..8e2be850ca 100644 --- a/lib/Config/Populator.php +++ b/lib/Config/Populator.php @@ -35,43 +35,46 @@ class Populator { 'NewsletterBlank12Column', 'NewsletterBlank121Column', 'NewsletterBlank13Column', - 'PostNotificationsBlank1Column', - 'WelcomeBlank1Column', - 'WelcomeBlank12Column', 'SimpleText', - 'AppWelcome', - 'WorldCup', - 'FoodBox', 'TakeAHike', - 'FestivalEvent', - 'PieceOfCake', - 'Shoes', - 'ScienceWeekly', 'Faith', 'NewsDay', - 'YogaStudio', - 'FashionStore', - 'Charity', + 'WorldCup', + 'FoodBox', + 'FestivalEvent', + 'RetroComputingMagazine', + 'Shoes', + 'PieceOfCake', + 'Coffee', 'Drone', + 'Retro', 'Hotels', 'Music', - 'Retro', - 'Coffee', - 'RetroComputingMagazine', - 'RealEstate', + 'YogaStudio', + 'Charity', + 'FashionStore', + + 'WelcomeBlank1Column', + 'WelcomeBlank12Column', 'GiftWelcome', 'Minimal', 'Phone', 'Sunglasses', + 'RealEstate', + 'AppWelcome', + + 'PostNotificationsBlank1Column', 'ModularStyleStories', 'NotSoMedium', 'RssSimpleNews', 'WideStoryLayout', - 'Avocado', + 'ScienceWeekly', + + 'WineCity', 'DogFood', 'Fitness', 'KidsClothing', - 'WineCity', + 'Avocado', ); }