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
This commit is contained in:
Ingo Schommer 2010-04-14 04:08:51 +00:00
parent a9c9aaef67
commit c3e001f82c

View File

@ -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)";
}