mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
Merge pull request #81 from nedmas/patch-3
ENHANCEMENT: Use File->Title to set default Title
This commit is contained in:
commit
7d74977491
@ -156,15 +156,13 @@ class GridFieldBulkUpload_Request extends RequestHandler
|
||||
$title = $record->getTitle();
|
||||
if ( !$title || $title === $record->ID )
|
||||
{
|
||||
$title = basename($uploadedFile->getFilename());
|
||||
|
||||
if ( $record->hasDatabaseField('Title') )
|
||||
{
|
||||
$record->Title = $title;
|
||||
$record->Title = $uploadedFile->Title;
|
||||
$record->write();
|
||||
}
|
||||
else if ($record->hasDatabaseField('Name')){
|
||||
$record->Name = $title;
|
||||
$record->Name = $uploadedFile->Title;
|
||||
$record->write();
|
||||
}
|
||||
}
|
||||
@ -287,4 +285,4 @@ class GridFieldBulkUpload_Request extends RequestHandler
|
||||
return Controller::join_links($this->gridField->Link(), '/bulkupload/', $action);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user