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

Command icon 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:

  • 3571305-field-type-needs Comparecompare
  • 1 hidden branch
  • 1.0.x Comparecompare

Comments

joachim created an issue. See original summary.

bluegeek9’s picture

Category: Bug report » Task

niklp made their first commit to this issue’s fork.

bluegeek9 changed the visibility of the branch 1.0.x to hidden.