Skip to content

Commit 04025c7

Browse files
authored
Merge branch '0.1' into main
2 parents d3f80ef + 1a90993 commit 04025c7

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

admin/controller/object.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@
297297
);
298298
if ($relation->getMany() > 1) {
299299
$data['relations'][$table]['rows'] = $data['item'][$name];
300-
} else {
300+
} else if (isset($data['item'][$name][$primary])) {
301301
$data['relations'][$table]['id'] = $data['item'][$name][$primary];
302302
$data['relations'][$table]['item'] = $data['item'][$name];
303303
}

admin/template/object/detail/relation/_detail.html

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
<table class="table">
33
<tbody>
44
{{#each relations}}
5-
{{#when many '==' 1}}
6-
<tr>
7-
<th nowrap>{{singular}}</th>
8-
<td>
9-
<a
10-
data-do="panel-mobile-forward"
11-
data-on="click"
12-
data-template="/admin/spa/system/object/{{name}}/detail/{{id}}"
13-
href="javascript:void(0)"
14-
>
15-
{{{compile suggestion ../item}}}
16-
</a>
17-
</td>
18-
</tr>
5+
{{#when many '<' 2}}
6+
{{#if id}}
7+
<tr>
8+
<th nowrap>{{singular}}</th>
9+
<td>
10+
<a
11+
data-do="panel-mobile-forward"
12+
data-on="click"
13+
data-template="/admin/spa/system/object/{{name}}/detail/{{id}}"
14+
href="javascript:void(0)"
15+
>
16+
{{{compile suggestion ../item}}}
17+
</a>
18+
</td>
19+
</tr>
20+
{{/if}}
1921
{{/when}}
2022
{{/each}}
2123
</tbody>

0 commit comments

Comments
 (0)