mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
a9c9aaef67
commit
c3e001f82c
@ -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)";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user