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


API changes

None. Method is just moved to parent interface.

#1 9449-typed-data-onchange-01.patch2.13 KBJose Reyero
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 79,541 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


Jose Reyero’s picture

Issue tags: +typed data, +D8MI
2.13 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 79,541 pass(es). View

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.