Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity Reference field handler: restrict reference by ID only to integer field types and integer values #283

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vaish
Copy link

@vaish vaish commented Dec 25, 2024

This resolves regression introduced by PR #241. It builds on the PR #280 but introduces some improvements:

  1. It ensures value must be positive integer (decimal numbers are not accepted).
  2. It partially restores logic that was introduced in Allow Entity Reference Field Handler to Refernce by ID #241 but removed in Restrict reference by ID to numeric values on integer fields #280: It supports finding the referenced entity by label or by ID but only when that makes sense.

In addition I also removed redundant if code block. Condition in that block is already covered by else section of the previous if block.

Resolves #278

amanpilgrim and others added 3 commits November 8, 2024 10:58
jhedstrom#241 introduced regression when using entity labels with a postgres database

SQLSTATE[22P02]: Invalid text representation: 7
 ERROR: invalid input syntax for type bigint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using a name for a user in an entity reference field, uid 0 gets chosen
2 participants