Prevent site builders from handling domain-less content in unsupported ways

Created on 13 December 2023, 7 months ago

Drupal Version

10.1.7

Domain module version

2.0.0-beta1

Expected Behavior

Receive a warning when trying to delete domain fields from content types.

Actual Behavior

For content types that don't have domain fields strange access issue appear after running node_access_rebuild() on different domains.

Steps to reproduce

- Create two domains, e.g domain1 and domain2
- Create a role with access to edit article node types (the permission from drupal core)
- Remove both domain fields form the article content type. This I what I figured I should do if I want a content type be available on all domains.
- Login with the admin user on domain1 and create an article node
- Rebuild access permission on admin/reports/status/rebuild on domain1
- Create a user with only that newly created role and login on domain2
- Try to edit the article and receive an access denied
- Login with the admin on domain2 and rebuild access permissions
- Try again to edit the article with the non-admin user successfully.

Restoring the two domain fields on the article content type and then rebuilding access on the default domain solves the issue.

Rebuilding access permissions on a non-default domain still gives access denied errors for users that have permissions to perform the operations, it happens for viewing nodes too so I think there some bug here as one has to be careful to edit nodes and rebuild access from the default domain.

My point here is that I made the mistake of removing the domain access-related fields from content types when that lead to many hard-to-debug errors so I feel we should display a warning when a user attempts to delete the domain fields from a content type.

✨ Feature request
Status

Active

Version

2.0

Component

Documentation

Created by

πŸ‡ͺπŸ‡ΈSpain rodrigoaguilera Barcelona

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

Comments & Activities

Production build 0.69.0 2024