Code improvements in TeaserBehaviorBase

Created on 17 March 2025, 21 days ago

Problem/Motivation

I found two things in abstract class Drupal\openculturas_teaser\Plugin\paragraphs\Behavior that should be improved:

  1. getBaseBuildArray() the potentially expensive function getTeaserMediaId() and then overrides its result with a static value, if that is given. getTeaserMediaId() should only be called if necessary.
  2. In getTeaserMediaId(), a condition on $item['type'] doesn't check if that key exists, resulting in a notice.
📌 Task
Status

Active

Version

2.4

Component

Code

Created by

🇩🇪Germany mrshowerman Munich

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

Comments & Activities

Production build 0.71.5 2024