Closed (fixed)
Project:
Field Config Cardinality
Version:
4.0.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Feb 2024 at 05:06 UTC
Updated:
11 Aug 2025 at 23:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
madelyncruz commentedComment #4
vijayavelr commentedHi @madelyncruz , I reviewed the steps
Before :
After following the Steps to reproduce
1) Create an entity reference field.
2) Set the default limit to unlimited.
3) Set the cardinality limit to 1.
4) Go to the entity form.
Comment #5
madelyncruz commentedComment #6
madelyncruz commented@vijayavelr, I edited #4 on how to replicate the issue. The form widget has to "Inline entity form - Simple (Cardinality)". could you please try again?
Comment #7
vijayavelr commentedHi
Comment #8
vijayavelr commentedHi @madelyncruz
Before :

I have done extend as you mentioned and checked the file from this commit 791ac1c3
and added in the file web\modules\contrib\field_config_cardinality\field_config_cardinality.module
use Drupal\field_config_cardinality\Plugin\Field\FieldWidget\CardinalityEntityReferenceIefSimpleWidget;
if (isset($info['inline_entity_form_simple'])) {
$info['inline_entity_form_simple']['class'] = CardinalityEntityReferenceIefSimpleWidget::class;
}
Its working fine.
Thank you.
Comment #9
vijayavelr commentedComment #10
vijayavelr commentedComment #11
vijayavelr commentedComment #12
madelyncruz commentedComment #14
smustgrave commentedLets update the MR and use attribute
Comment #18
smustgrave commentedAdded test coverage
Comment #19
andre.bonon@smustgrave, not all sites have the inline_entity_form installed, so it needs to check if the module exists before executing.
https://git.drupalcode.org/project/field_config_cardinality/-/merge_requ...
Comment #20
smustgrave commentedYou can see in the test that the module is installed and was added to the require-dev so it will be there for the tests.
Comment #21
andre.bononOh sorry, that makes sense.
Comment #22
smustgrave commentedNo worries!