Closed (fixed)
Project:
Entity Browser
Version:
8.x-2.x-dev
Component:
Field widget
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jan 2024 at 10:44 UTC
Updated:
17 May 2026 at 17:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
r_cheh commentedComment #3
r_cheh commentedComment #4
benstallings commentedClaude Code says:
This is correct:
- getCardinality() is the proper API method defined on FieldStorageDefinitionInterface
- ->get() is a generic property accessor on config entities that bypasses any logic in the getter — if getCardinality() ever adds processing (e.g., normalizing values), get() would miss it
- Better for static analysis and IDE support — get('cardinality') returns mixed, while getCardinality() has a proper return type
No functional change in current Drupal core (both return the same integer), but it's the right API to use.
Verdict: Trivial, correct fix. Good to merge.
Comment #7
anybodyhttps://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Field%21F...
Correct! Thanks!!
Comment #8
anybody