mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-04 02:05:16 +02:00
Do not throw an exception during rendering of log detail page, if element has no time travel URL
This commit is contained in:
parent
e68827bf3b
commit
efc152e3c8
3 changed files with 18 additions and 5 deletions
|
@ -32,10 +32,13 @@
|
|||
<i class="fas fa-fw fa-backward" title="{% trans %}log.undo.revert{% endtrans %}"></i> {{ 'log.undo.revert.short' | trans }}
|
||||
</button>
|
||||
|
||||
{% set url = timetravel_url(target_element, entry.timestamp) %}
|
||||
|
||||
{# View button #}
|
||||
{% if target_element and ((attribute(entry, 'oldDataInformation') is defined and entry.oldDataInformation)
|
||||
or entry is instanceof('App\\Entity\\LogSystem\\CollectionElementDeleted')) %}
|
||||
<a class="btn btn-outline-secondary" href="{{ timetravel_url(target_element, entry.timestamp)}}"><i class="fas fa-fw fa-eye"></i>
|
||||
or entry is instanceof('App\\Entity\\LogSystem\\CollectionElementDeleted'))
|
||||
and url is not null %}
|
||||
<a class="btn btn-outline-secondary" href="{{ url }}"><i class="fas fa-fw fa-eye"></i>
|
||||
{% trans %}log.view_version{% endtrans %}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue