ContextDefinition violates DataDefinitionInterface by calling methods that might not exist

Created on 1 February 2016, over 8 years ago
Updated 7 February 2023, over 1 year ago

Problem/Motivation

ContextDefinition::getDataDefinition() retrieves DataDefinitionInterface objects. Then it invokes setter methods on them that are not defined on the interface.

Proposed resolution

Option 1:

Per the backward compatibility policy β†’ , this is viable and the easiest.
Break the API by adding the methods to the interface, assuming no one has implemented the interface directly without extending DataDefinition.

Option 2:

This should not be needed, as adding new methods to an interface does not break BC
Add a new MutableDataDefinitionInterface which contains the setters. DataDefinition then implements this interface, and we can properly check if setters are available.

Option 3:

To stay API compatible don't change the interface and introduce method_exists() calls instead?

Remaining tasks

Decide on option + Patch + test.

User interface changes

none.

API changes

Depends on the option chosen.

Data model changes

none.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
Typed dataΒ  β†’

Last updated 6 days ago

  • Maintained by
  • πŸ‡¦πŸ‡ΉAustria @fago
Created by

πŸ‡¦πŸ‡ΉAustria klausi πŸ‡¦πŸ‡Ή Vienna

Live updates comments and jobs are added and updated live.
  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024