KeepeekSource should not use formatter from any display mode

Created on 19 June 2025, about 1 month ago

Problem/Motivation

The KeepeekSource media plugin resolves a formatter from core.entity.view_display.media.[BUNDLE].default config to retreive a formatter class name and call "deriveMediaDefaultNameFromUrl()" on this formatter if no "title" value found in json.

This creates a strong coupling between the source and the view display. Site builders are not able to configure the default view display as they may want without affecting the module stability.

Proposed resolution

As the deriveMediaDefaultNameFromUrl() is a static method, just call it from the KeepeekSource like this :

return KeepeekFormatterBase::deriveMediaDefaultNameFromUrl($url);

To allow other modules to alter it, dispatch an event with the source configuration, the media entity and the json and use its result (if not empty).

I don't think a plugin manager would be usefull here because the processing if json data would be hard to make configurable and I don't see any situation that a contrib module would provide such alter feature without requiring the keepeek module.

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇫🇷France mattlc

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024