I’m trying to customize the System Page > Default Page, but keep getting the “Liquid Error: Object reference not set to an instance of an object.” error.
In trying to debug, here’s what I’ve uncovered. If I compare strings it fails. If I compare integers it works:
This works:
{% if 1 ==1 %}
true
{% else %}
false
{% endif %}
And this fails:
{% if “1” == “1” %}
true
{% else %}
false
{% endif %}
I’m trying to implement something like the following to redirect a user submitted custom module after using the input form:
{% if this.PageType == “AddNewModuleItemSuccess” %}
{% if this.FormSubmissionData.ModuleItem.ParentId == “2437” %}
use js to redirect to item url
{% endif %}
{% else %}
< div>
{{this.Message}}
< /div>
{% endif %}
Yes, looks like the bug is to do with user submitted items not following the same URL convention as what is generated when adding items in the admin.
It keeps the spaces in the URL and so we need the %20 encoding for a space.
But the Liquid output in the form submission shows it with dashes.
Ideally, the user-submission process should convert spaces to dashes for consistency.