Problem/Motivation

There is an error occasionally:

Error message
Warning: Undefined array key "name" in Drupal\project_browser\Plugin\ProjectBrowserSource\DrupalDotOrgJsonApi->getProjects() (line 399 of modules/custom/project_browser/src/Plugin/ProjectBrowserSource/DrupalDotOrgJsonApi.php).
Drupal\project_browser\Plugin\ProjectBrowserSource\DrupalDotOrgJsonApi->getProjects() (Line: 170)
Drupal\project_browser\EnabledSourceHandler->doQuery() (Line: 125)
Drupal\project_browser\EnabledSourceHandler->getProjects() (Line: 59)
Drupal\project_browser\Controller\ProjectBrowserEndpointController->getAllProjects()
call_user_func_array() (Line: 123)

Steps to reproduce

I do not yet know how to reproduce this. It happens rarely, but usually when I'm manually testing an MR so I'm clicking around and doing a LOT.

My HUNCH is it has to do with some projects not having any maintainers or maintainer paragraphs (maybe just having to do with that data not having been migrated to the D10 site yet??)

Proposed resolution

Be more failsafe in our assumption that the name key exists in the array?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chrisfromredfin created an issue. See original summary.

chrisfromredfin’s picture

Title: PHP warning » PHP warning - Undefined array key "name" in DrupalDotOrgJsonApi.php

fjgarlin made their first commit to this issue’s fork.

fjgarlin’s picture

Status: Active » Needs review

Ready for review.

MR: https://git.drupalcode.org/project/project_browser/-/merge_requests/692

I was initially putting a warning via the "logger" service, but I don't think it's really needed, so I removed it in this commit. No author could happen if the person who created the module canceled their account, so the project still exists but is assigned to anonymous user.

I created #3502734: Remove author from Project as well.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

This seems like a sensible change.

tim.plunkett’s picture

Saving credit

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

Merged !692 🎉

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.