Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Internal Server Error when trying to delete an entry

Go to End



Community Member, 46 Posts

11 October 2013 at 11:21pm


I'm using 3.0.5, and currently using the ModelAdmin for several data objects which is great (makes life a heck of a lot easier).

However, I want to prevent deletion of certain items, so have put the following:

   public function canDelete() {
		return false;   

While on the main view this removes to delete icon, when you click into an record it still shows a delete button. When you click it, it shows 'Internal Server Error', and generates the following:
[Fri Oct 11 10:50:41 2013] [error] [client] AH01215: PHP Fatal error: Call to a member function message() on a non-object in /silverstripe_folder/framework/forms/gridfield/GridFieldDetailForm.php on line 454

On top of that, the function "canDelete" only appears to work on one of several data objects. Any suggestions on either of these please, as I'm a bit baffled!

Thanks in advance!