3

I have written two lightning components and they work as expected on my summer 16 dev org, but when I install the components as an unmanaged package on another winter 16 dev org I get below error

Something has gone wrong. [NoErrorObjectAvailable] Access Check Failed! AttributeSet.get(): attribute 'myWS' of component 'markup://c:workstreams {3:2;a}' is not visible to 'markup://c:workstreams {3:2;a}'. . Please try again.

below is the code of First component, Can anyone suggest what the issue could be since the same code works in my primary dev org.

<aura:component controller="itma_Controller" implements="force:appHostable" access="global">
<!-- Handle component initialization in a client-side controller -->
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<!-- Dynamically load the list of work streams -->
<aura:attribute name="workstreams" type="Work_Stream__c[]"/>

<div class="slds-page-header slds-clearfix" role="banner">
  <div class="slds-media slds-media--center">
    <div class="slds-media__figure">
      <!-- to-do: add icon-->
    </div>
    <div class="slds-media__body">

        <h1 class="slds-page-header__title slds-m-right--small slds-align-middle" title="Record Title">Work streams</h1>       
    </div>
    <div class="slds-float--right">
        <!-- Display record create page when button is clicked -->
        <ui:button label="New work stream" press="{!c.createRecord}" class="newWSbtn"/>
    </div>
  </div>
</div>

<div class="uiselectContainer">
    <!-- Create a drop-down list with  options -->
    <ui:inputSelect aura:id="selection" change="{!c.select}">
        <ui:inputSelectOption text="Work Streams I Follow" label="Work streams I follow"/>
       <ui:inputSelectOption text="Work Streams I Own" label="Work streams I own"/>
       <ui:inputSelectOption text="All Work Streams" label="All work streams"/>       
    </ui:inputSelect>
</div>

<!-- Iterate over the list of work streams and display them -->
<aura:iteration var="workstream" items="{!v.myWS}">
    <c:workstreamList ws="{!workstream}"/>
</aura:iteration>

Controller

    ({
    doInit : function(component, event, helper) {
        // Retrieve work streams during component initialization
        helper.getmyWS(component);
    },//Delimiter for future code
    createRecord : function (component, event, helper) {
    // Open the create record page
    var createRecordEvent = $A.get("e.force:createRecord");
    createRecordEvent.setParams({
        "entityApiName": "Work_Stream__c"
    });
    createRecordEvent.fire();
},
select : function(component, event, helper){
    // Get the selected value of the ui:inputSelect component
    var selectCmp = component.find("selection");
    var selectVal = selectCmp.get("v.value");
    // Display all Work Streams or all contacts
    if (selectVal==="All Work Streams"){
        var action = component.get("c.getAll");
        action.setCallback(this, function(response){
            var state = response.getState();
            if (component.isValid() && state === "SUCCESS") {
                component.set("v.myWS", response.getReturnValue());
            }
});
        $A.enqueueAction(action);
    } //Display Work Streams owned by user
        else if (selectVal==="Work Streams I Own"){
        var action = component.get("c.getOwnedWS");
        action.setCallback(this, function(response){
            var state = response.getState();
            if (component.isValid() && state === "SUCCESS") {
                component.set("v.myWS", response.getReturnValue());
            }
});
        $A.enqueueAction(action);
    }
    else {
        // Return Work Streams User Follows
        helper.getmyWS(component);
} }
})

Helper

    ({
    getmyWS : function(cmp) {
        // Load all  data
        var action = cmp.get("c.getmyWS");
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (cmp.isValid() && state === "SUCCESS") {
                cmp.set("v.myWS", response.getReturnValue());
            }

});
 $A.enqueueAction(action);} })
  • 4
    I don't see the myWS attribute defined in your component. Can you try adding that attribute definition? – prashanthkr Jul 20 '16 at 1:25
  • @prashanthkr adding myWS attribute resolved the issue, but I am still baffled how the same code worked in my primary Dev org. - Thanks – Chookloo Jul 20 '16 at 12:53

Browse other questions tagged or ask your own question.