浏览代码

Show link should be used if we doesn't have the edit route

If we have the EDIT role but not the edit route, the identifier doesn't contains a link to the show action
Benoît Lévêque 10 年之前
父节点
当前提交
ff45197497
共有 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;
         }