Home Analyst Portal

Customized pages lost after upgrade to v9

Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭
Hi, I successfully upgraded my portal to v9. One issue I'm still having is that the pages that I customized in the custom area at c:\inetpub\ciresonportal\customspace are apparently not loaded. In other words, I think I'm seeing the default home page instead of my customisation.

Any hints as to what I may be overlooking ?

Stephane

Best Answer

  • Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭
    Answer ✓
    Hi, Cireson support helped me debug this problem, and it was caused by a syntax change

    $(window).load(function() { ... })

    is no longer valid, and has to be replaced by

    $(window).on('load', function() { ... })

    everything below that instruction in my custom.js was ignored.

Answers

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.
    Hey @Stephane_Bouillon

    Can't think of anything. Have you cleared cache etc?
    Are we talking about a form customisation here such as Incident.js
    Are these files still in CustomSpace (they get moved out and back during upgrade)
    Any errors in the browser?

    Geoff
  • Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭
    Thanks for your response Geoff. Yes I cleared the cache (even rebooted the server). Our customisations are in custom.js and custom.css. Some items are hidden and there is a bit of custom html. This is what our home page looked like before the upgrade:



    I did not change anything in our custom.js file, but our homepage now looks like this:



    The debugger shows the following messages in the console:


    I contacted Cireson support, and their response was "It appears the customisation is loaded, but it hasn't been updated for the new version."

    I guess I could redo my custom.js customisations, but I don't know which file I have to take as a starting point.
  • Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭
    Thanks for your response Geoff. Yes I cleared the cache (even rebooted the server). Our customisations are in custom.js and custom.css. Some items are hidden and there is a bit of custom html. This is what our home page looked like before the upgrade:



    I did not change anything in our custom.js file, but our homepage now looks like this:



    The debugger shows the following messages in the console:


    I contacted Cireson support, and their response was "It appears the customisation is loaded, but it hasn't been updated for the new version."

    I guess I could redo my custom.js customisations, but I don't know which file I have to take as a starting point.

    Below is my code (sorry I'm not allowed to add it as an attachment)

    /* ----------------------------------------------- */<br>/* ----------------- Script Loader --------------- */<br>/* ----------------------------------------------- */
    // This helps with loading scripts and debugging<br>// Pass in the path of the js file and an array of url segments on which to run this code<br>// EG loadScript("/CustomSpace/CustomExtension/CustomExtension.js",["ServiceRequest","Incident"]);<br>var loadScript = function (path,urls) { <br>&nbsp;urls.forEach(function(url){&nbsp;<br>&nbsp;&nbsp;if(window.location.href.indexOf(url) !== -1){ // Verify we are on the valid page<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;var result = $.Deferred(),<br>&nbsp;&nbsp;&nbsp;&nbsp;script = document.createElement("script");<br>&nbsp;&nbsp;&nbsp;script.async = "async";<br>&nbsp;&nbsp;&nbsp;script.type = "text/javascript";<br>&nbsp;&nbsp;&nbsp;script.src = path;<br>&nbsp;&nbsp;&nbsp;script.onload = script.onreadystatechange = function(_, isAbort) {<br>&nbsp;&nbsp;&nbsp;&nbsp;if (!script.readyState || /loaded|complete/.test(script.readyState)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (isAbort)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.reject();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.resolve();<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;};<br>&nbsp;&nbsp;&nbsp;script.onerror = function () { result.reject(); };<br>&nbsp;&nbsp;&nbsp;$("head")[0].appendChild(script);<br>&nbsp;&nbsp;&nbsp;console.log("Loaded " + path)<br>&nbsp;&nbsp;&nbsp;return result.promise();<br>&nbsp;&nbsp;}<br>&nbsp;})<br>};
    /* ----------------------------------------------- */<br>/* --------------- END Script Loader ------------- */<br>/* ----------------------------------------------- */
    </code></pre><pre class="CodeBlock"><code>// custom workitem preview on hover in wi grid<br>$.getScript("/CustomSpace/custom_WorkItemPreview.js");
    //Show custom home page<br>$(window).load(function() {<br>&nbsp;if (window.location.pathname == "/View/94ecd540-714b-49dc-82d1-0b34bf11888f"){<br>&nbsp;&nbsp;$("#alertMessagesContainer").before(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "<table style='width: 95%' align='center'><tbody><tr><td width= '120px'><a href='https://servicedesk.multipharma.be/View/02efdc70-55c7-4ba8-9804-ca01631c1a54?filter=services'><img style='float: right;' height='120px' width='120px' src='/Content/Images/Custom/incident.png'></a></td><td valign='top'><div class='col-md-12' size='20'><a href='https://servicedesk.multipharma.be/View/02efdc70-55c7-4ba8-9804-ca01631c1a54?filter=services'><b>Incidents</b></a></div><br><div class='col-md-12'>Si vous avez un problème, une question ou quelque chose ne fonctionne plus correctement, créez un ticket Incident.<br><br>Indien U een probleem of vraag hebt, of iets werkt niet meer naar behoren, maak dan een&nbsp; Incident ticket aan.</div></td><td width= '120px'><a href='https://servicedesk.multipharma.be/View/02efdc70-55c7-4ba8-9804-ca01631c1a54?filter=incidents'><img style='float: right;' height='120px' width='120px' src='/Content/Images/Custom/service.png'></a></td><td valign='top'><div class='col-md-12' size='20'><a href='https://servicedesk.multipharma.be/View/02efdc70-55c7-4ba8-9804-ca01631c1a54?filter=incidents'><b>Service Request</b></a></div><br><div class='col-md-12'>Si vous avez un besoin d’équipement, d’une application ou une autre demande de service, choisissez parmi les catégories de services pour créer un ticket Service Request.<br><br>Indien U een verzoek hebt om materiaal, een toepassing of een andere service vraag, kies dan uit de beschikbare services om een Service Request ticket aan te maken.</div></td></tr><tr><td width= '120px'><a href='https://servicedesk.multipharma.be/Page/7a00971b-f8cb-4f80-a0f1-84049a4355b3'><img style='float: right;' height='120px' width='120px' src='/Content/Images/Custom/info.png'></a></td><td valign='top'><div class='col-md-12' size='20'><br><a href='https://servicedesk.multipharma.be/Page/7a00971b-f8cb-4f80-a0f1-84049a4355b3'><b>Info</b></a></div><br><div class='col-md-12'>Si vous n’avez jamais utilisé le Portail Service Desk, cliquez ici pour démarrer rapidement.<br><br>Heb je nog nooit de Service Desk Portal gebruikt, klik dan hier om snel van start te gaan.</div></td><td width= '120px'><a href='https://servicedesk.multipharma.be/View/0aef4765-0efa-4a65-84c1-324b09231223'><img style='float: right;' height='120px' width='120px' src='/Content/Images/Custom/howto.png'></a></td><td valign='top'><div class='col-md-12' size='20'><br><a href='https://servicedesk.multipharma.be/View/0aef4765-0efa-4a65-84c1-324b09231223'><b>How-To</b></a></div><br><div class='col-md-12'>Guides d’utilisation, bonnes pratiques, questions et réponses.<br><br>Gebruikershandleidingen en tips, best practices, vragen en antwoorden.</div></td></tr></tbody></table>",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "<br><hr style='width: 95%'><br>"//<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //The service catalog and request offerings don't load immediately. So wait until it does load.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var mainPageNode = document.getElementById('main_wrapper');<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // create an observer instance<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var observer = new MutationObserver(function(mutations) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //The page changed. See if any RO descriptions exist yet. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var titleElements = $("*.mini-template-body");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //var titleElements = $("*.so.blocks");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //if (titleElements.length > 0) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (titleElements.length > 0) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fn_HideHomeOfferings();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; observer.disconnect();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // configure the observer. For our purposes, subtree is required.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var observerConfig = { attributes: true, childList: true, subtree: true, characterData: true };<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // pass in the node, and our mutationobserver options.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; observer.observe(mainPageNode, observerConfig);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function fn_HideHomeOfferings() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; $("div[class*='service-catalog-content']").hide(); //Hides all<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; $("div[class*='col-lg-10']").hide(); //Hide all but browse by category<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $("div[class*='topfav-row']").show();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $("div[id*='catalog-area']").hide(); //Hide catalog items<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $("div[data-bind*='visible: topRO']").hide(); //Hide top RO<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $("div[data-bind*='visible: topKA']").hide(); //Hide top KA<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $("div[data-bind*='visible: taxonomyVisible']").hide(); //Hide Browse By Category<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $("div[data-bind*='visible: catalogVisible']").hide(); //Hide Catalog<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $("div[data-bind*='visible: homeBC']").hide(); //Hide Browse By Category <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $("div[data-bind*='text: scLabel']").hide(); //Hide All requests<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //
    <br>//*/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp; if(window.location.pathname.indexOf("View/02efdc70-55c7-4ba8-9804-ca01631c1a54") === 1){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Set homepage section with incident en request info<br>&nbsp;&nbsp;$("#alertMessagesContainer").before(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "<table style='width: 95%' align='center'><tbody><tr><td width= '120px'><a href='https://servicedesk.multipharma.be/View/02efdc70-55c7-4ba8-9804-ca01631c1a54?filter=services'><img style='float: right;' height='120px' width='120px' src='/Content/Images/Custom/incident.png'></a></td><td><div class='col-md-12' size='20'><a href='https://servicedesk.multipharma.be/View/02efdc70-55c7-4ba8-9804-ca01631c1a54?filter=services'><b>Incidents</b></a></div><br><div class='col-md-12'>Si vous avez un problème, une question ou quelque chose ne fonctionne plus correctement, créez un ticket Incident.<br><br>Indien U een probleem of vraag hebt, of iets werkt niet meer naar behoren, maak dan een&nbsp; Incident ticket aan.</div></td><td width= '120px'><a href='https://servicedesk.multipharma.be/View/02efdc70-55c7-4ba8-9804-ca01631c1a54?filter=incidents'><img style='float: right;' height='120px' width='120px' src='/Content/Images/Custom/service.png'></a></td><td><div class='col-md-12' size='20'><a href='https://servicedesk.multipharma.be/View/02efdc70-55c7-4ba8-9804-ca01631c1a54?filter=incidents'><b>Service Request</b></a></div><br><div class='col-md-12'>Si vous avez un besoin d’équipement, d’une application ou une autre demande de service, choisissez parmi les catégories de services pour créer un ticket Service Request.<br><br>Indien U een verzoek hebt om materiaal, een toepassing of een andere service vraag, kies dan uit de beschikbare services om een Service Request ticket aan te maken.</div></td></tr></tbody></table>",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "<br><hr style='width: 95%'>"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Hide Home Title<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(document).ready(function () {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var hideMenuCount = 0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var hideMenu = setInterval(function hideHomeTitle()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($(".page_bar .page_title:contains(" + localization.Home + ")").length > 0&nbsp; || hideMenuCount > 100)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(".page_bar .page_title:contains(" + localization.Home + ")").hide();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $("div[data-bind*='visible: homeBC']").hide(); //Hide All requests<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $("div[data-bind*='text: scLabel']").hide(); //Hide All requests<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clearInterval(hideMenu);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //fail safe<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hideMenuCount++;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }, 10)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });

    <br>...<br>
  • Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭
    I also seem to have lost the Advanced search widget on the home page :(
  • Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭
    My custom.css file now contains a lot of items with   !important   next to the property value. Why is that ? I did not put them there.
  • Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭
    Answer ✓
    Hi, Cireson support helped me debug this problem, and it was caused by a syntax change

    $(window).load(function() { ... })

    is no longer valid, and has to be replaced by

    $(window).on('load', function() { ... })

    everything below that instruction in my custom.js was ignored.

Sign In or Register to comment.