From df53250bb24f462373d24a7d4460a2d5fced2cbe Mon Sep 17 00:00:00 2001
From: Alex Orluc <alex.orluc@maarch.org>
Date: Mon, 30 Apr 2018 18:29:21 +0200
Subject: [PATCH] FIX #7203 change .contents() => unsupported for IE11 + bad
 var in change_contact_type()

(cherry picked from commit a1960cfdf575b942d1241470825f4d230e7d07cd)
---
 apps/maarch_entreprise/js/indexing.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/apps/maarch_entreprise/js/indexing.js b/apps/maarch_entreprise/js/indexing.js
index 1a9e90acf3b..80d9e9b2671 100755
--- a/apps/maarch_entreprise/js/indexing.js
+++ b/apps/maarch_entreprise/js/indexing.js
@@ -1244,7 +1244,7 @@ function change_contact_type(path_autocomplete, empty_contact_div, id_internal,
 				Element.setStyle(show_multi_contact, {display : 'none'});
 				Element.setStyle(add_multi_contact, {display : 'none'});
 				// NCH01
-                var cat_id = $(category_id).options[$(category_id).selectedIndex].value;
+                var cat_id = $('category_id').options[$('category_id').selectedIndex].value;
                 if(cat_id != 'attachment') Element.setStyle(contact_id_tr, {display : 'table-row'});
 			}
         }
@@ -1342,10 +1342,11 @@ function changeCycle(path_manage_script)
 
 function getIframeContent(path_manage_script)
 {
-    if ($j('#choose_file_div') && $j("#file_iframe").contents()[0]) {
+    var iframe = document.getElementById("file_iframe");
+    if ($j('#choose_file_div') && iframe.contentDocument) {
         var choose_file_div = $('choose_file_div');
         if (choose_file_div.style.display == 'none') {
-            var iframe = document.getElementById("file_iframe");
+            
             var iframeContent = iframe.contentDocument;
             var templateContent2 = iframeContent.getElementById("template_content_ifr");
             //window.alert(templateContent2);
-- 
GitLab