3

I am working on a Community using the latest Napili (Spring 16) Template. I have a page which uses a custom lightning component, that displays a list of keys belonging to the logged in user.

The page was working until the Spring 16 release. We hadn't pushed any changes as we were prepping to launch the Community. Now the page simply never stops loading the user can no longer navigate the Community or even log out.

I have checked the access="global" attribute and the forceCommunity interface, both are included.

MyProduct.cmp:

<aura:component controller="CommunityMyProductsController" implements="forceCommunity:availableForAllPageTypes" access="global">
   <aura:attribute name="keys" type="List" access="global"/>
   <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
   <!-- Use the Apex model and controller to fetch server side data -->
    <ltng:require styles="/resource/SLDS0122/assets/styles/salesforce-lightning-design-system-ltng.css"/>
<div class="slds">
       <h2>Active Products</h2>
  <div class="slds" style="margin-top:10px;margin-left:10px;">
   <table class="slds-table slds-table--bordered slds-table--striped">
      <thead>
        <tr>
           <th scope="col"><span class="slds-truncate">Status</span></th>
           <th scope="col"><span class="slds-truncate">Product Line</span></th>
           <th scope="col"><span class="slds-truncate">License Activation Key</span></th>
           <th scope="col"><span class="slds-truncate">Maintenance Level</span></th>
           <th scope="col"><span class="slds-truncate">Start Date</span></th>
           <th scope="col"><span class="slds-truncate">License Valid Date</span></th>
           <th scope="col"><span class="slds-truncate"></span></th>
        </tr>
      </thead>
      <tbody>
        <aura:iteration items="{!v.keys}" var="key">
         <tr>
           <td>{!key.Status__c}</td>
           <td>{!key.Product_Line__c}</td>                 
           <td>{!key.Software_Key__c}</td>
           <td>{!key.Maintenance_Level__c}</td>                 
           <td>{!key.Start_Date__c}</td>
           <td>{!key.License_Valid_Date__c}</td>

             <td><button type="button" class="slds-button slds-button--brand" onclick="{!c.showDetails}" data-data="{!key.Software_Key__c}">New Case</button></td>
             </tr> 
        </aura:iteration>
      </tbody>
   </table>
    </div>
</div>

MyProductsController.js:

    ({
   doInit: function(component, event, helper) {      
      //Fetch the keys from the Apex controller
      helper.getMyProductList(component);
   },
   showDetails: function(component, event, helper) {
        //Get data via "data-data" attribute from button (button itself or icon's parentNode)
        var id = event.target.getAttribute("data-data") || event.target.parentNode.getAttribute("data-data")
        alert("Please copy the following key to your clipboard: " + id);
   },
    //Call send renewal email from Apex controller
    getKey: function(component, event, helper) {
        var key = event.target.getAttribute("data-data");
        var action = component.get("c.sendRenewalRequest");
        action.setParams({
          "keyId": key
        });
        action.setCallback(this, function(a) {
            // display the product to the chrome dev console (for fun)
            console.log(a.getReturnValue());
            alert("Your request for renewal has been sent");
        });
        $A.enqueueAction(action);
    },
})

And finally the Apex controller MyProductsController.cls:

public with sharing class MyProductsController {

    public MyProductsController() {}

   @AuraEnabled
   public static List<Software_Key__c> getKeys() {
    User portalUser = [SELECT Id, username, profile.name, contact.accountid FROM User WHERE Id = :UserInfo.getUserId()];
        return [SELECT Id,
                     Name,
                     License_Status__c, 
                     Maintenance_Level__c, 
                     Start_Date__c,     
                     Product_Line__c, 
                     License_Valid_Date__c,
                     Account__c,
                     Software_Key__c,
                     License_Type__c,
                     Status__c,
                     Product_Name__c
                     FROM Software_Key__c
                     WHERE Account__c = :portalUser.contact.accountid 
                     AND Status__c = 'Valid' 
                     ORDER BY Product_Name__c DESC];
   }
}

What has been happening since Saturday (release day): Never stops loading!

  • 1
    You can wrap this in aura:application and read the error outside the community builder which should hint you what broke it .I feel like some syntax have changed in Spring 16 – Mohith Shrivastava Feb 17 '16 at 19:30
  • Weird is all I say – Mohith Shrivastava Feb 17 '16 at 20:04
0

This is not the best solution, but for some reason it works. I simply created a new lightning component, with a different name, but kept all the code exactly the same. I put the new component in a new page and now it loads fine in the Community.

In case anyone comes across this, I am actually using the Winter '16 Napili Template, but according to the release notes it should not matter: http://docs.releasenotes.salesforce.com/en-us/spring16/release-notes/rn_networks_templates_upgrade_to_lightning.htm The issue didn't start until the Spring 16 release, even though I have not upgraded to the Spring 16 template. I would upgrade, but of course that would also erase all of my customizations...

UPDATE: update from Tier-3 and R & D team regarding the root cause of the issue.

“There was an issue with the standard background images for the community templates. In the end, we were able to just refresh them on our side (making no changes to their setup) - and it looks like the images got populated and it's working now. we logged in to your org and it's all working as designed now”.

  • Also noting that I have a case open with Tier-3 and they don't know what the root cause it so far – Matt Parker Feb 17 '16 at 20:07
  • Can you post the case ID so I can see about shepherding it a bit? I've also alerted the Communities team directly. – Doug Chasman Feb 17 '16 at 21:11
  • @DougChasman Case #13143398 - thanks! – Matt Parker Feb 18 '16 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.