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, biapar, Willr, Ingo, swaiba, simon_w

Internal Server Error when trying to delete an entry


Reply


298 Views

Avatar
Parker1090

Community Member, 38 Posts

11 October 2013 at 11:21pm

Hello,

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 xxx.xxx.xxx.xxx] 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!