From 0a187eae0ab33b460c538d7b2a90698796f22b70 Mon Sep 17 00:00:00 2001 From: Sabina Talipova Date: Mon, 31 Jul 2023 16:21:00 +1200 Subject: [PATCH] DOC Warnings about searchable_fields content --- en/02_Developer_Guides/00_Model/11_Scaffolding.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/en/02_Developer_Guides/00_Model/11_Scaffolding.md b/en/02_Developer_Guides/00_Model/11_Scaffolding.md index cab050a17..0aa91e54d 100644 --- a/en/02_Developer_Guides/00_Model/11_Scaffolding.md +++ b/en/02_Developer_Guides/00_Model/11_Scaffolding.md @@ -70,10 +70,13 @@ The `$searchable_fields` property uses a mixed array format that can be used to system. The default is a set of array values listing the fields. [info] -`$searchable_fields` will default to use the [`$summary_fields` config](#summary-fields) if not defined. This works fine unless -your `$summary_fields` config specifies fields that are not stored in the database. +`$searchable_fields` will default to use the [`$summary_fields` config](#summary-fields), excluding anything that isn't a database field (such as method calls) if not explicitly defined. [/info] +[warning] +If you define a `searchable_fields` configuration, _do not_ specify fields that are not stored in the database (such as methods), as this will cause an error. +[/warning] + ```php use SilverStripe\ORM\DataObject;