esmero/archipelago-deployment

Twig template for Object Description doesn't check for null values.

Closed this issue · 2 comments

aksm commented

What?

This may not be the only instance but as one example:

 		{% if data.related_item_host_display_label|length < 0 and data.related_item_host_title_info_title|length > 0 %}
        	<h6>Related Item Host Title Info: </h6><p>{{ data.related_item_host_title_info_title }}</p>
        {% endif %}

The above doesn't check for null values and results in an empty body so it could for example be fixed by:

 		{% if (data.related_item_host_display_label|length < 0 or data.related_item_host_display_label is null) and data.related_item_host_title_info_title|length > 0 %}
        	<h6>Related Item Host Title Info: </h6><p>{{ data.related_item_host_title_info_title }}</p>
        {% endif %}

Example object that illustrates the problem is Mechanics' Institute Quarterly, Vol. 2 No. 2

This will require more checking through the rest of the Additional Information logic.

Hi @aksm! This issue was fixed yesterday via f53f18b . Think this is the only place in the template with that potential problem.

aksm commented

Resolved by f53f18b and 25e302c.