Do not throw an 500 error, if mapping is not possible

This fixes issue #1298
This commit is contained in:
Jan Böhmer 2026-03-15 21:47:15 +01:00
parent 74e5102943
commit 95f3fc66c2
2 changed files with 45 additions and 31 deletions

View file

@ -62,12 +62,20 @@
<code>{{ field }}</code> <code>{{ field }}</code>
</td> </td>
<td> <td>
{# TODO: This is more a workaround than a proper fix. Ideally the controller should be fixed in a way, that we get the correct fields here #}
{% if field_name_mapping[field] is defined %}
{% set field_name = field_name_mapping[field] %}
{{ form_widget(form['mapping_' ~ field_name_mapping[field]], { {{ form_widget(form['mapping_' ~ field_name_mapping[field]], {
'attr': { 'attr': {
'class': 'form-select field-mapping-select', 'class': 'form-select field-mapping-select',
'data-field': field 'data-field': field
} }
}) }} }) }}
{% else %}
<b class="text-danger">
{% trans %}project.bom_import.field_mapping.error.check_delimiter{% endtrans %}
</b>
{% endif %}
</td> </td>
<td> <td>
{% if suggested_mapping[field] is defined %} {% if suggested_mapping[field] is defined %}

View file

@ -12947,5 +12947,11 @@ Buerklin-API Authentication server:
<target>[Part_lot] created from barcode: Please check if the data is correct and desired.</target> <target>[Part_lot] created from barcode: Please check if the data is correct and desired.</target>
</segment> </segment>
</unit> </unit>
<unit id="F8pQuL9" name="project.bom_import.field_mapping.error.check_delimiter">
<segment>
<source>project.bom_import.field_mapping.error.check_delimiter</source>
<target>Mapping error: Check if you have selected the right delimiter!</target>
</segment>
</unit>
</file> </file>
</xliff> </xliff>