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',
|
'data_path' => 'meta_template.id',
|
||||||
'element' => 'function',
|
'element' => 'function',
|
||||||
'function' => function($row, $viewContext) use ($baseurl) {
|
'function' => function($row, $viewContext) use ($baseurl) {
|
||||||
return $viewContext->Bootstrap->node('a', [
|
if (!empty($row->meta_template)) {
|
||||||
'href' => h($baseurl . '/metaTemplates/view/' . $row->meta_template->id ?? ''),
|
return $viewContext->Bootstrap->node('a', [
|
||||||
], !empty($row->meta_template->name) ? (sprintf('%s (v%s)', h($row->meta_template->name), h($row->meta_template->version))) :'');
|
'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