mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Merge pull request #201 from assertchris/hide-merge-for-empty-parents
Hide merge for empty parents
This commit is contained in:
commit
40b05482a8
@ -64,7 +64,7 @@ class GridFieldMergeAction implements GridField_ColumnProvider, GridField_Action
|
|||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getColumnContent($gridField, $record, $columnName) {
|
public function getColumnContent($gridField, $record, $columnName) {
|
||||||
if($columnName === 'MergeAction') {
|
if($columnName === 'MergeAction' && $record->{$this->childMethod}()->Count() > 0) {
|
||||||
$dropdown = new DropdownField('Target', 'Target', $this->records->exclude('ID', $record->ID)->map());
|
$dropdown = new DropdownField('Target', 'Target', $this->records->exclude('ID', $record->ID)->map());
|
||||||
|
|
||||||
$prefix = strtolower($this->parentMethod . '-' . $this->childMethod);
|
$prefix = strtolower($this->parentMethod . '-' . $this->childMethod);
|
||||||
|
Loading…
Reference in New Issue
Block a user