From c3e001f82ca2a3fdf66e7587b13ea79ca58859f5 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 14 Apr 2010 04:08:51 +0000 Subject: [PATCH] BUGFIX: Take into account tablename with custom columns in get_title_sql (from r97003) (from r99101) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102848 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- security/Member.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/security/Member.php b/security/Member.php index 23771c180..8f66b79f0 100755 --- a/security/Member.php +++ b/security/Member.php @@ -746,8 +746,14 @@ class Member extends DataObject { * @return String SQL */ static function get_title_sql($tableName = 'Member') { + if (self::$title_format) { - return "CONCAT(".join("'".self::$title_format['sep']."'", self::$title_format['columns']).")"; + $columnsWithTablename = array(); + foreach(self::$title_format['columns'] as $column) { + $columnsWithTablename[] = "$tableName.$column"; + } + + return "CONCAT(".join("'".self::$title_format['sep']."'", $columnsWithTablename).")"; } else { return "CONCAT($tableName.Surname, ' ', $tableName.FirstName)"; }