function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
greenstorkgreenstork 

Problem extending a global virtual class from outside a managed package, in Spring '12

Hello,

 

We have two unmanaged apex controllers in our instance which extend a global virtual controller from a managed package. They are currently working correctly in our production instance and are failing in the Spring '12 Sandbox. Those controllers are: 

The system log would indicate in the Sandbox that there is some sort of recursive init of the classes and the constructors do not appear to be firing. Properties from the extended unmanaged classes are correctly rendering on the page and properties from the managed controller that is being extended are not being constructed. 

When tests are run in the Sandbox on these controllers, the error message is Insufficient Privileges. We have tried the controllers with and without sharing with the same results. The Debug Logs on test run are very short but do contain a blurb that says Internal Salesforce Error but no gack reference code. 

For any Salesforce PMs looking for more information, there is an active case: 06923723

 

Any insight into this issue would be apprciated.

 

Dave

greenstorkgreenstork

Here is the code for the extended controller, if that's useful:

 

public with sharing class RockwoodDonationFormController extends gwop.PaymentPageController {
	/**
	* @description Overrides the PaymentPageController to save the card expiration date, by updating the payment's custom field whenever the expMonth or expYear are set.
	*/
	
    public string expMonth {
    	get { return card.expMonth; }
    	set {
    		card.expMonth = value;
    		persistCustom();
    	}
    }
    
    public string expYear {
    	get { return card.expYear; }
    	set {
    		card.expYear = value;
    		persistCustom();
    	}
    }
    
    private void persistCustom() {
    	if (expYear != null && expMonth != null) {
	    	Date expDate = Date.newinstance(Integer.valueOf(expYear), Integer.valueOf(expMonth), 1);
	    	payment.custom = '{"opportunity": {"Card_Expiration_Date__c": ' + JSON.serialize(expDate) + '}}';
    	}
    }

    public static testmethod void test_persistCustom() {
    	RockwoodDonationFormController c = new RockwoodDonationFormController();
    	c.expMonth = '1';
    	c.expYear = '2012';
    	System.assertEquals('{"opportunity": {"Card_Expiration_Date__c": "2012-01-01"}}', c.payment.custom);
    }

}

 And the controller being extended is on Github, here:

https://github.com/Groundwire/Online-Payments/blob/master/src/classes/PaymentPageController.cls

greenstorkgreenstork

New info on this case.  I have continued dev in my sandbox, creating an entirely new controller for some other page. That controller is completely unmanaged and is also experiencing the same problem -- Insufficient Privileges on test runs with a gack message in the debug log.  

 

I went ahead and burned another sandbox just to figure out what was happening and lo and behold, that sandbox wasn't experiencing any of the same test failures, everything was passing just fine there.

 

The big difference, the original sandbox is on CS11 and the newly burned one is on CS10.

KyleGKyleG

I am experiencing a very similar problem .. have you heard anything new on this issue?

greenstorkgreenstork

This problem was completely resoved for me in a Thursday evening patch upgrade (from Salesforce) sometime in and around a month ago.  If you want to post back with your issue though, I'm happy to help you troubleshoot.

KyleGKyleG

My problem is basically like yours.  I have a unmanaged controller class that extends a global virtual class inside a managed package.  The Visualforce page that uses that controller loads fine initially, but when I use an apex:commandButton that calls an action on the controller class (whether the method is defined in the outside extension class or inside the managed package class) I get the error Insufficient Privileges and "You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary."

 

I also filed a case with Salesforce (07218177) and I gave them your case number since the problem seemed very similar.

 

One other interesting note is that this does not occur for ALL controller classes that extend a global virtual base class for me.  I have another case of that which works just fine.

     
KyleGKyleG
The salesforce support person has indicated the full error message is Access to entity 'Intake_Claim_WC_State__Feed' denied, Intake_Claim_WC_State__c is one of my custom objects, but no where in any of my code am I trying to access any __Feeds. Furthermore the method I am calling from my apex:commandButton click is completely empty.. I tried disabling Chatter altogether but that did not help.