Attempting to create a new contact before creating contact types causes error

Created on 21 August 2022, over 2 years ago
Updated 7 June 2023, over 1 year ago

Problem/Motivation

Attempting to create a new contact before creating contact types produces an error, showing an unformatted page with only the message: The website encountered an unexpected error. Please try again later.

Steps to reproduce

  1. Ensure there are no Contact Types created or listed at the "/admin/structure/redhen/contact_type" page
  2. Ensure the Database Logging module is enabled to capture any errors.
  3. Select Contacts from the RedHen menu, or just navigate to "/redhen/contact".
  4. At this page, click the "Add Contact" link.
  5. Result: You will see the reported error.
  6. If you navigate to the database logging page (/admin/reports/dblog), you will see an error starting with "TypeError: htmlspecialchars(): Argument #1 ($string)…"

Proposed resolution

Instead of allowing a site crash, display a warning to the user that they must create Contact Types prior to creating new contacts, and provide a link to the contact types page (/admin/structure/redhen/contact_type) where they can create at least one new contact type.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Shared

Created by

πŸ‡ΊπŸ‡ΈUnited States jmev

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