apostrophecms / apostrophecms/apostrophe

Unable to save new content

Open
#4,698 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
4.6k
Forks
650
Avg merge
19h 21m
Merged PRs (30d)
23

Description

## To Reproduce

Unsure if it is consistent, but this is what has been causing it for me:

1. Create a custom component with a relationship field to a page.
2. Add an instance of that component to a page (the root home page `/` in my case).
3. Select that same page as a value for the field on the custom component.
4. Publish
5. Try making and publishing a change to a different component on that page.

## Expected behavior
The changes get saved after clicking "Publish".

## Describe the bug
When clicking "Publish", the changes get reverted. The `/api/v1/@apostrophecms/page/` does not include any modified data.
Mind you, not every widget seemed equally affected by this. Rich text widgets in particular stopped saving entirely. It might also have to do with the position of the affected component (before/after) relative to the component that includes the recursive relationship.

My assumption is that the recursivity is what causes the issue. While I'm writing this, I'm remembering that the `project` property on the relationship would most likely fix this issue by excluding the page's content. Still I think this is worth looking into.

## Details

**Version of Node.js:** `v20.16.0`

**Server Operating System:** Windows 11 using WSL. The MongoDB database runs in a docker container.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue using the listed custom-component and recursive relationship steps, then inspect the `/api/v1/@apostrophecms/page/` response when publishing changes to another component. Done means the changes persist after clicking “Publish” and the modified data appears in the API response, including for rich text widgets.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript, mongodb, node.js
Domain
api, backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.