Given I have 2 meta entity types:

  1. Page views: mapped to the target bundle Article of type Node
  2. Likes: mapped to the target entity type User

When I create a new meta entity of type Like then I am currently allowed to select both a User entity or an Article as the target entity.

The MappedTargetEntityConstraint does not check if the target entity type belongs to the current meta entity, it is satisfied if the target entity is mapped to any meta entity type.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pfrenssen created an issue. See original summary.

pfrenssen’s picture

The last submitted patch, 2: 3080983-2.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 2: 3080983-2-test-only.patch, failed testing. View results

pfrenssen’s picture

Status: Needs work » Needs review
FileSize
3.68 KB
2.25 KB
662 bytes

Apparently this also uncovers a bug in the UniquePerMetaTypeAndTargetConstraintTest: the mapping of the download_count meta entity type was not defined in this test, but due to this bug this was not failing the test.

Status: Needs review » Needs work

The last submitted patch, 5: 3080983-5-test-only.patch, failed testing. View results

pfrenssen’s picture

Status: Needs work » Needs review

  • pfrenssen committed bc4b3d9 on 8.x-1.x
    Issue #3080983 by pfrenssen: Mapping constraint fails if target entity...
pfrenssen’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.