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?
Issue fork project_browser-3502643
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
Comment #2
chrisfromredfinComment #5
fjgarlin commentedReady 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.
Comment #6
phenaproximaThis seems like a sensible change.
Comment #7
tim.plunkettSaving credit
Comment #9
tim.plunkettMerged !692 🎉