Removed paragraphs still appear in JSON API endpoints

Created on 12 August 2024, 8 months ago

Problem/Motivation

We have a react app querying for paragraphs using the /jsonapi/paragraph/PARAGRAPH_TYPE endpoint. When a paragraph is removed from a node we expect the paragraph status to be 0, but it remains as 1, so it appears in the JSON API response.

Steps to reproduce

  • Install Drupal 10.3.x with standard profile
  • Install jsonapi and paragraphs modules
  • Create a paragraphs bundle "location" and add a paragraphs field to the Basic Page content type
  • Create a Basic Page with one paragraph on it
  • Create a new revision of the Basic Page and remove the paragraph from it
  • Log out
  • Access /jsonapi/paragraph/location as an anonymous user

Proposed resolution

Perhaps when a paragraph is removed from a node revision, a new paragraphs revision should be created with status = 0 and that should be the default revision for the paragraph.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia mstrelan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024