Message of the day:
Release 4.5.0 is out. Changelog: https://docs.silverstripe.org/en/4/changelogs/4.5.0
SilverStripe 4 related information and questions.
Im trying to shown an extra DB field that I've added to a DataObject via DataExtension as a Summary Field but it's returning the error:
Array to String conversion. Can anyone see what I'm doing wrong? I feel like its something obvious:
- private static $db = [
- 'AccountTypes' => 'Varchar(255)',
- private static $summary_fields = [
- private static $field_labels = [
- 'AccountTypes' => 'Account Types'
Weird: Renaming the DB field to something else fixed it
do you by any chance have a method on that data object that goes by the name of
getAccountTypes which returns an array?
I'm trying to rename a field from the Silverstripe Blogs module (the Blog->BlogPosts field), but I can't for the life of me figure out how. I have tried
updateCMSFields , and
beforeUpdateCMSFields , but none of them seem to be able to read the given field from the FieldList in the context, always returning NULL with calls like
$fields->fieldByName('BlogPosts'). I've even tried looking for it through an extension using
Does anyone have a tip to how I can change the CMS label for this field?
field as a gridfield or tab?
The grid field is the field I'm trying to rename, but I can't find either of the two 🤔
"rename" -> another label in the CMS for the customer? Or do you need to rename the actual DB field or relation?
Also, when looking in the module code I can't find anywhere the field is actually explicitly added, which makes me think something exceptional is done to add the field.
@wmk Just the label, so the field will be labelled "Events" rather than "Blog Posts"
Blog module uses lumberjack to add the grid
I'm assuming that has some effect on the field-generation then? I am not familiar with lumberjack.