IT Monkey:   Click Here to Help Me Build the Agenda for Upcoming Cireson Webinars!

Customized pages lost after upgrade to v9

Stephane_BouillonStephane_Bouillon Customer Adept 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 Adept IT Monkey ✭✭
    Accepted 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 Super IT Monkey ✭✭✭✭✭
    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 Adept 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 Adept 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)

    /* ----------------------------------------------- */
    /* ----------------- Script Loader --------------- */
    /* ----------------------------------------------- */
    // This helps with loading scripts and debugging
    // Pass in the path of the js file and an array of url segments on which to run this code
    // EG loadScript("/CustomSpace/CustomExtension/CustomExtension.js",["ServiceRequest","Incident"]);
    var loadScript = function (path,urls) {
     urls.forEach(function(url){ 
      if(window.location.href.indexOf(url) !== -1){ // Verify we are on the valid page
      
       var result = $.Deferred(),
        script = document.createElement("script");
       script.async = "async";
       script.type = "text/javascript";
       script.src = path;
       script.onload = script.onreadystatechange = function(_, isAbort) {
        if (!script.readyState || /loaded|complete/.test(script.readyState)) {
         if (isAbort)
          result.reject();
         else
          result.resolve();
        }
       };
       script.onerror = function () { result.reject(); };
       $("head")[0].appendChild(script);
       console.log("Loaded " + path)
       return result.promise();
      }
     })
    };
    /* ----------------------------------------------- */
    /* --------------- END Script Loader ------------- */
    /* ----------------------------------------------- */
    // custom workitem preview on hover in wi grid
    $.getScript("/CustomSpace/custom_WorkItemPreview.js");
    //Show custom home page
    $(window).load(function() {
     if (window.location.pathname == "/View/94ecd540-714b-49dc-82d1-0b34bf11888f"){
      $("#alertMessagesContainer").before(
                "<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  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><hr style='width: 95%'><br>"//<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"
            );
           
        
            //The service catalog and request offerings don't load immediately. So wait until it does load.
            var mainPageNode = document.getElementById('main_wrapper');
           
                // create an observer instance
                var observer = new MutationObserver(function(mutations) {
                    //The page changed. See if any RO descriptions exist yet.
                    var titleElements = $("*.mini-template-body");
                    //var titleElements = $("*.so.blocks");               
                    //if (titleElements.length > 0) {
                    if (titleElements.length > 0) {
                        fn_HideHomeOfferings();
                        observer.disconnect();
                    }
                });
            // configure the observer. For our purposes, subtree is required.
            var observerConfig = { attributes: true, childList: true, subtree: true, characterData: true };
               
            // pass in the node, and our mutationobserver options.
            observer.observe(mainPageNode, observerConfig);
          
            function fn_HideHomeOfferings() {
            //  $("div[class*='service-catalog-content']").hide(); //Hides all
            //  $("div[class*='col-lg-10']").hide(); //Hide all but browse by category
               $("div[class*='topfav-row']").show();
               $("div[id*='catalog-area']").hide(); //Hide catalog items
               $("div[data-bind*='visible: topRO']").hide(); //Hide top RO
               $("div[data-bind*='visible: topKA']").hide(); //Hide top KA
               $("div[data-bind*='visible: taxonomyVisible']").hide(); //Hide Browse By Category
               $("div[data-bind*='visible: catalogVisible']").hide(); //Hide Catalog
               $("div[data-bind*='visible: homeBC']").hide(); //Hide Browse By Category
               $("div[data-bind*='text: scLabel']").hide(); //Hide All requests
            }
            //

    //*/
          
            //    
        };
        if(window.location.pathname.indexOf("View/02efdc70-55c7-4ba8-9804-ca01631c1a54") === 1){
            //Set homepage section with incident en request info
      $("#alertMessagesContainer").before(
                "<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  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><hr style='width: 95%'>"
            );
            // Hide Home Title
            $(document).ready(function () {
                var hideMenuCount = 0;
                var hideMenu = setInterval(function hideHomeTitle()
                {        
                    if ($(".page_bar .page_title:contains(" + localization.Home + ")").length > 0  || hideMenuCount > 100)
                    {
                        $(".page_bar .page_title:contains(" + localization.Home + ")").hide();
                        $("div[data-bind*='visible: homeBC']").hide(); //Hide All requests
                        $("div[data-bind*='text: scLabel']").hide(); //Hide All requests
                        clearInterval(hideMenu);
                    }
                    //fail safe
                    hideMenuCount++;              
                }, 10)
            });

    ...

  • Stephane_BouillonStephane_Bouillon Customer Adept IT Monkey ✭✭
    I also seem to have lost the Advanced search widget on the home page :(
  • Stephane_BouillonStephane_Bouillon Customer Adept 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 Adept IT Monkey ✭✭
    Accepted 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.