Add setting to EntityReferenceSelection plugins to prevent references to referencing entity

Created on 5 June 2014, about 10 years ago
Updated 28 March 2024, 3 months ago

Problem/Motivation

There should be an option to prevent entity reference plugins from referencing itself.

Steps to reproduce

Create a node with an entity reference field that can reference nodes. Observe that the current node can be referenced. It should be possible to prevent this.

Proposed resolution

Add a checkbox titled "Allow an entity to reference itself" to the field settings under "Manage fields". This is checked by default. When un-checked, prevent referencing itself.

Remaining tasks

None.

User interface changes

Add checkbox to field configuration.

API changes

None.

Data model changes

Add configuration for site builders to choose whether to prevent self-references.

Release notes snippet

โœจ Feature request
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Entityย  โ†’

Last updated about 6 hours ago

  • Maintained by
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom @catch
  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland @Berdir
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany @hchonov
Created by

Live updates comments and jobs are added and updated live.
  • Contributed project blocker

    It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.

  • Needs usability review

    Used to alert the usability topic maintainer(s) that an issue significantly affects (or has the potential to affect) the usability of Drupal, and their signoff is needed. When adding this tag, make it easy to review the issue. Make sure the issue summary describes the problem and the proposed solution. Screenshots usually help a lot! To get sign-off on issues with the "Needs usability review" tag, post about them in the #ux channel on Drupal Slack, and/or attend a UX meeting to demo the patch and get direct feedback from designers/UX folks/product management on next steps. If an issue represents a significant new feature, UI change, or change to the general "user experience" of Drupal, use Needs product manager review instead. See the scope of responsibilities for product managers.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024