Skip to content

Commit 82b1854

Browse files
authored
PRO-8187: render-areas should not crash when related docs with areas are present (#5038)
1 parent 0158239 commit 82b1854

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* When specifying a modal name to be executed, developers may now register "transformers" to be invoked first, using pipe syntax. For example, the modal name `aposSectionTemplateLibraryWidgetToDoc|AposDocEditor` will invoke the transformer `aposSectionTemplateLibraryWidgetToDoc` with the original props, and pass the returned result to `AposDocEditor`. Note that transformers are awaited. Transformers are registered in frontend admin UI code by passing a name and a function to `apos.ui.addTransformer`.
1111
* Adds quick image upload UI to `@apostrophecms/image-widget`.
1212

13+
### Fixes
14+
15+
* The `?render-areas=1` API feature now correctly disregards areas in separate documents loaded via relationship fields. Formerly their presence resulted in an error, not a rendering.
16+
1317
## 4.20.0 (2025-08-06)
1418

1519
### Adds

modules/@apostrophecms/area/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ module.exports = {
383383
return;
384384
}
385385
// We're only rendering areas on the document, not ancestor or
386-
// child page documents.
387-
const regex = /^_(ancestors|children)|\._(ancestors|children)/;
386+
// child page or related documents.
387+
const regex = /^_|\._/;
388388
if (dotPath.match(regex)) {
389389
return;
390390
}

0 commit comments

Comments
 (0)