Skip to content

Allow finding renamed behaviors by their former names #18

@pysailor

Description

@pysailor

Motivation
Triggered by plone/plone.app.contenttypes#480
A commonly used behavior (ILeadImage) was modified so that its dotted name changed.

While an upgrade step took care of changing the behavior registration for the affected content types, there are still other pieces of code / content that still use the old dotted name. A prominent example is the history stored via CMFEditions / plone.app.versioningbehavior.

Proposal
Extend the behavior registration with a new field former_dotted_names that allows to document the old dotted name in case of a change.

When a behavior is looked up by name, and no behavior is found, we check if the given name is registered as a former name. That means that the lookup of a behavior will be extended with a fallback, so that the behavior is still found under its old name. Additionally, we issue a warning in the log, to raise attention that a now deprecated dotted name was used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions