From 01cba92d5ee3aa0a376a6878204f7f06f185aadc Mon Sep 17 00:00:00 2001
From: Arun Sahijpal <69732-arunsahijpal@users.noreply.drupalcode.org>
Date: Fri, 21 Feb 2025 18:51:21 +0000
Subject: [PATCH] Issue #3506377 by arunsahijpal, narendrar, phenaproxima,
 fjgarlin: Warning: Undefined array key "missing"

---
 src/Plugin/DrupalDotOrgSourceBase.php | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/Plugin/DrupalDotOrgSourceBase.php b/src/Plugin/DrupalDotOrgSourceBase.php
index 367907993..74a362459 100644
--- a/src/Plugin/DrupalDotOrgSourceBase.php
+++ b/src/Plugin/DrupalDotOrgSourceBase.php
@@ -554,13 +554,15 @@ abstract class DrupalDotOrgSourceBase extends ProjectBrowserSourceBase implement
     if (is_array($project_images) && is_array($related)) {
       $images = [];
       foreach ($project_images as $image) {
-        $uri = self::DRUPAL_ORG_ENDPOINT . $related[$image['type']][$image['id']]['uri']['url'];
-        // Adapt the path as we are querying via www.drupal.org.
-        $uri = str_replace(self::DRUPAL_ORG_ENDPOINT . '/assets/', self::DRUPAL_ORG_ENDPOINT . '/files/', $uri);
-        $images[] = [
-          'file' => Url::fromUri($uri),
-          'alt' => $image['meta']['alt'] ?? '',
-        ];
+        if ($image['id'] !== 'missing') {
+          $uri = self::DRUPAL_ORG_ENDPOINT . $related[$image['type']][$image['id']]['uri']['url'];
+          // Adapt the path as we are querying via www.drupal.org.
+          $uri = str_replace(self::DRUPAL_ORG_ENDPOINT . '/assets/', self::DRUPAL_ORG_ENDPOINT . '/files/', $uri);
+          $images[] = [
+            'file' => Url::fromUri($uri),
+            'alt' => $image['meta']['alt'] ?? '',
+          ];
+        }
       }
       $project_images = $images;
     }
-- 
GitLab