Fatal error if redhen contact is used as a view argument and logged-in user has no contact

Created on 11 July 2022, over 2 years ago
Updated 24 January 2023, almost 2 years ago

Problem/Motivation

If you create a view using the "Contact ID from logged in user's connected Contact" argument type, then long in as a user who has no redhen contact (like user 1) and visit the view, you get this error:

Error: Call to a member function id() on bool in Drupal\redhen_contact\Plugin\views\argument_default\CurrentContact->getArgument() (line 26 of modules/contrib/redhen/modules/redhen_contact/src/Plugin/views/argument_default/CurrentContact.php).

Proposed resolution

We just need to check to make sure there is a contact before we try to call ->id() on it.

πŸ› Bug report
Status

Fixed

Component

redhen_contact

Created by

πŸ‡ΊπŸ‡ΈUnited States mariacha1

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024