Upgrading to 4.3: the method 'scaffoldSearchField' does not exist

Upon upgrading from SilverStripe 4.2.3 to 4.3.0 I’m finding many of my sites are breaking. Specifically GridFields, I end up with the following error:

[Emergency] Uncaught BadMethodCallException: Object->__call(): the method 'scaffoldSearchField' does not exist on 'PurpleSpider\MySite\Category'

This seems to be something to do with the new GridFieldFilterHeader, but I don’t see anything in the upgrade docs about this particular issue.

What’s the correct way to resolve this? My DO is very basic:

class Category extends DataObject {
	
  private static $db = [
    'Name' => 'Text'
  ];
	
  private static $has_one = [
    'SalesPage' => SalesPage::class
  ];
	
  	private static $has_many = [
    "SaleItems" => SaleItem::class
  ];
	
  private static $summary_fields = [
    'Name'=>'Category Name'
  ];
  
  private static $table_name = 'Category';
  
  function getCMSFields() {
  		
  	$fields = new FieldList(
  		new TextField('Name')
  	);
    
  	return $fields;		
  }

  function canCreate($member = null, $context = []) {
  	return true;
  }

  function canEdit($members = null) {
  	return true;
  }

  function canDelete($members = null) {
  	return true;
  }

  function canView($members = null) {
  	return true;
  }
}

This looks like a bug. Do you have a call stack for the error, please? That would give us a better idea where to look.

Sure: GET /admin/pages/edit/show/44

1 Like

I’ve created a matching issue on GitHub.

1 Like