mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-14 19:29:34 +01:00
Fixed an exception on admin pages, if the element does not contain parts.
This commit is contained in:
@@ -254,6 +254,7 @@ abstract class BaseAdminController extends AbstractController
|
||||
'pdf_data' => $pdf_data ?? null,
|
||||
'timeTravel' => $timeTravel_timestamp,
|
||||
'repo' => $repo,
|
||||
'partsContainingElement' => $repo instanceof PartsContainingRepositoryInterface,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<label class="col-form-label col-md-3">{% trans %}entity.info.parts_count{% endtrans %}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static">
|
||||
{% if entity.id and repo.partsCount is defined %}
|
||||
{% if entity.id and partsContainingElement %}
|
||||
{{ repo.partsCount(entity) }}
|
||||
{% else %}
|
||||
-
|
||||
|
||||
Reference in New Issue
Block a user