Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It is possible to access a disabled resource via the include
parameter, related routes and relationship routes.
When the field is a single field, the related route results in a 500 Internal Server Error
with the detail, "Route \"jsonapi.user--user.individual\" does not exist."
This was uncovered as part of #2932035: ResourceTypes should be internal when EntityType::isInternal is TRUE.
... I just noticed that the UI says: "Disabling a resource can have unexpected results when following relationships belonging to that resource."
Since this throws a 500, I still think it's worth reporting.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2933354--fix-related-relationship-disabled--4.patch | 8.7 KB | e0ipso |
#2 | 2933354--fix-related-relationship-disabled--2.patch | 8.19 KB | e0ipso |
|
Comments
Comment #2
e0ipsoKicking off tests.
Comment #4
e0ipsoThis requires the latest JSON API release (1.7).
Comment #6
e0ipsoComment #7
Wim LeersBy this, @e0ipso means #2933615: Fix related and relationships endpoints for disabled resources.
Comment #9
AnybodyI created an issue for the opposite requirement: Being able to add the reference data (like it was a scalar field value and not an entity reference), even if the target entity type resource is disabled, so it can't be requested directly: #3437873: Disabled resources vs. includes (for referenced data)
Would be great to have your feedback!