A full-featured, open-source content management framework built with Node.js that empowers organizations by combining in-context editing and headless architecture in a full-stack JS environment.
I think I discovered a pretty interesting bug. I get this server error which comes up when a very specific schema configuration is set:
Template render error: (default-page:page.html)
Template render error: (@apostrophecms/area:area.html)
Template render error: (test-widget:widget.html)
Error: The doc of type undefined with the slug undefined has no field named area.
In Apostrophe 3.x areas must be part of the schema for each page or piece type.
at Object._prettifyError (/Users/stepanjakl/Git/a3-boilerplate/node_modules/nunjucks/src/lib.js:36:11)
... 3 lines matching cause stack trace ...
at extension.run (/Users/stepanjakl/Git/a3-boilerplate/node_modules/apostrophe/modules/@apostrophecms/template/index.js:445:22) {
Essentially, if there's a nested array inside an array - both with the same slug - and once an area is created, it breaks. This has been tested in a newly created A3 boilerplate project.
Here's the full code:
// widget.html
{% for item in data.widget.items %}
{% for subItem in item.items %}
<span>{{ subItem.title }}</span>
{% endfor %}
{% if item.area.items|length > 0 -%}
{% area item, 'area' %}
{%- endif %}
{% endfor %}
Hello team,
I think I discovered a pretty interesting bug. I get this server error which comes up when a very specific schema configuration is set:
Essentially, if there's a nested array inside an array - both with the same slug - and once an area is created, it breaks. This has been tested in a newly created A3 boilerplate project.
Here's the full code:
To Reproduce
Step by step instructions to reproduce the behavior:
Details
Version of Node.js: v18.4.0
Server Operating System: MacOS Ventura 13.3.1