Problem/Motivation
The application logic that only one item in a field can be the primary is only enforced at the widget level. It should be enforced with a constraint.
Steps to reproduce
// Create a node with 2 values, then load it and do this:
$node->field_test_per[0]->primary = 1;
$node->field_test_per[1]->primary = 1;
dsm($node->validate()); // This should show a validation error, but it does not!
$node->save();
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork primary_entity_reference-3571305
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
bluegeek9 commented