Problem/Motivation
Especially when the cardinality is 1, it is not natural for people to know they have to add another item before the existing one can be removed. The Remove option should always be there; regular validation can handle the enforcement of the field not being empty, same as when it is new and has no references yet.
Comments
Comment #2
mlncn commentedOK this is actually a bug, that it does not already work the way i expect:
The reason the count seems to be off, at least in my case, is because getReferenceableEntities() returns an array of bundles, and inside that the entities, so in the case of the user reference it counts the one bundle— not the two entities that it should count. (There are many more than two, but the code limits the maximum results to two, because it only cares if it is zero, one, or more than one.)
This is indeed exactly what the getReferenceableEntities method says it will return:
We can probably save ourselves a step, and fix this bug, by using the countReferenceableEntities() method.
Comment #4
mlncn commented@TODO offer same patch to IEF