Skip to content

Instantly share code, notes, and snippets.

@wilr
Created January 29, 2019 01:58
Show Gist options
  • Save wilr/7c59f577e1d072eb66e4c0c84cba6732 to your computer and use it in GitHub Desktop.
Save wilr/7c59f577e1d072eb66e4c0c84cba6732 to your computer and use it in GitHub Desktop.
Uncaught Error: Call to a member function scaffoldSearchField() on string
<?php
use SilverStripe\ORM\DataObject;
class TestBlock extends DataObject
{
private static $summary_fields = [
'getReadableState' => [
'title' => 'State'
]
];
/**
* @return string
*/
public function getReadableState()
{
return 'Test';
}
}
@wilr
Copy link
Author

wilr commented Jan 29, 2019

Fix is to return an object explicitly DBText::create('Test')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment