瀏覽代碼

Merge pull request #2956 from BenoitLeveque/fix-addIdentifier-when-we-doesnt-have-edit-route

Show link should be used if we doesn't have the edit route
Thomas 10 年之前
父節點
當前提交
9807b046ce
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Datagrid/ListMapper.php

+ 1 - 1
Datagrid/ListMapper.php

@@ -52,7 +52,7 @@ class ListMapper extends BaseMapper
         $fieldDescriptionOptions['identifier'] = true;
 
         if (!isset($fieldDescriptionOptions['route']['name'])) {
-            $routeName = $this->admin->isGranted('EDIT') ? 'edit' : 'show';
+            $routeName = ($this->admin->isGranted('EDIT') && $this->admin->hasRoute('edit')) ? 'edit' : 'show';
             $fieldDescriptionOptions['route']['name'] = $routeName;
         }