fix: [meta-template-name-directory] Do not access property from null object
parent
768bbcb996
commit
7df0169ecf
|
@ -47,9 +47,13 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
|||
'data_path' => 'meta_template.id',
|
||||
'element' => 'function',
|
||||
'function' => function($row, $viewContext) use ($baseurl) {
|
||||
if (!empty($row->meta_template)) {
|
||||
return $viewContext->Bootstrap->node('a', [
|
||||
'href' => h($baseurl . '/metaTemplates/view/' . $row->meta_template->id ?? ''),
|
||||
], !empty($row->meta_template->name) ? (sprintf('%s (v%s)', h($row->meta_template->name), h($row->meta_template->version))) :'');
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
],
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue