From 8240cd47acc36a29c82b6568616313e131ef933e Mon Sep 17 00:00:00 2001
From: pbarroca <pbarroca@afi-sa.fr>
Date: Fri, 20 Jan 2017 12:23:22 +0100
Subject: [PATCH] dev #53936 : no need to apply variant if its already there

---
 library/Class/Profil/Preferences.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/library/Class/Profil/Preferences.php b/library/Class/Profil/Preferences.php
index f204d655c03..4163229c76d 100644
--- a/library/Class/Profil/Preferences.php
+++ b/library/Class/Profil/Preferences.php
@@ -67,7 +67,8 @@ class Class_Profil_Preferences {
 
 
   public function applyModulePrefVariant($profile, $module_definition, $variant) {
-    if (!$profile || !$module_definition || !$variant)
+    if (!$profile || !$module_definition || !$variant
+        || $module_definition->getSubAction() == $variant)
       return $this;
 
     $pref = $this->getModulePref($profile, $module_definition);
-- 
GitLab