Enonic version: 6.14.0
It seems like since Enonic 6.14.0 templates cannot be empty.
For example, if we have a part template like this:
And if an expression is set to false, the template is simply empty and the page crashes and returns an error:
String index out of range: 0 (java.lang.StringIndexOutOfBoundsException)
Is there some new rules how to handle this? Or is this a bug? Earlier(6.13.0) we did not face this error.
Are you using Page Contributions in this controller? We introduced a change here in 6.14 making it always return arrays, never strings.
Does it crash if you wrap that section with something that is always rendered?
We did all the required changes to make Page Contributions work properly, so it is not the issue with Page Contributions.
Yes, the error is fixed if I wrap it with anything that is always rendered, but is it correct behavior? Empty blocks(wrappers) would appear in this case. I believe it wasn’t so earlier.
Can you copy the whole stacktrace of the error that appears in the log?
This is caused by a bug introduced in 6.14, unfortunately.
If the HTML output from a part (or layout) is empy, it will fail during page rendering.
We will fix this isue in 6.14.1, which hopefully will be released at the end of next week.
As a workaround for now you can try with making it an empty tag (section, div, etc) instead of empty string.
Something like this:
OK. Thanks for the information.