Formatters shouldn't repeat core code

Created on 10 January 2022, about 3 years ago
Updated 28 February 2023, almost 2 years ago

Problem/Motivation

All 3 field formatters provided by this module (SvgImageFormatter, SvgImageUrlFormatter and SvgResponsiveImageFormatter) extend core classes. However, they copy most of the code from the parent class instead of calling parent methods and modifying their result.
This is bad practice, because updates to the parent classes have to be introduced in the child classes as well, otherwise we're missing new features.

Proposed resolution

Instead of repeating code, call the parent method and alter its result where necessary.

Remaining tasks

Write patch.

User interface changes

None.

API changes

None.

Data model changes

None.

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇩🇪Germany mrshowerman Munich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

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.71.5 2024