Просмотр исходного кода

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 лет назад
Родитель
Сommit
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;
         }