Problem/Motivation

The TypedData::setValue() method invokes the onChange() method on the parent typed data object.
While the parent is of type TraversableTypedDataInterface, that method is not part of the interface.

This can be fixed now because we've got a proper interface for the parent typed data which is TraversableTypedDataInterface.
See #2346129: Introduce a TraversableTypedDataInterface and use that for typehinting instead of ArrayElement

Note this is not an issue introduced by that new interface as it was existing before of that. It is an issue that can be fixed now because we've got that new interface.

Proposed resolution

Move that method one level up in the interface hierarchy, to TraversableTypedDataInterface

User interface changes

None

API changes

None. Method is just moved to parent interface.

CommentFileSizeAuthor
#1 9449-typed-data-onchange-01.patch2.13 KBJose Reyero
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jose Reyero’s picture

Issue tags: +typed data, +D8MI
FileSize
2.13 KB

Simple patch that fixes the issue and also saves a few lines of code.

Jose Reyero’s picture

Status: Active » Needs review

Run tests

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +sprint, +language-config

This makes total sense.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 388758f and pushed to 8.0.x. Thanks!

  • alexpott committed 388758f on 8.0.x
    Issue #2359449 by Jose Reyero: Fixed TypedData calls onChange() parent's...
Gábor Hojtsy’s picture

Issue tags: -sprint

Superb, thanks.

Status: Fixed » Closed (fixed)

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