Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aksm opened this issue Aug 13, 2022 · 2 comments
Closed

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

aksm opened this issue Aug 13, 2022 · 2 comments
Assignees
Labels
Twig {% burp %}

Comments

@aksm
Copy link
Contributor

aksm commented Aug 13, 2022

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.

@aksm aksm added the Twig {% burp %} label Aug 13, 2022
@aksm aksm self-assigned this Aug 13, 2022
@alliomeria
Copy link
Contributor

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

@aksm
Copy link
Contributor Author

aksm commented Aug 15, 2022

Resolved by f53f18b and 25e302c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Twig {% burp %}
Projects
None yet
Development

No branches or pull requests

2 participants