Skip to content

Conversation

@OGRoomService
Copy link

Add a null check so it doesn't blindly capture data that may not exist. This was causing an issue where the template wouldn't render if the "parent_type" was null in the database.

Description

We had an issue where emails just were not loading in DetailView. It took forever to figure out why this was happening, and then even longer to figure out what was responsible for it. If an email has nothing set for related to, the associated field of parent_id is NULL in the database, which causes the capture to fail and not render the template on the page.

Bug Issue

Motivation and Context

Emails not containing parent data will simply not render in the template because of an error within the capture. Adding a null check resolves this issue and will display the detailed view of an email.

How To Test This

  1. Have an email in the database with parent_type set to null, or an empty string.
  2. Attempt to view that email record http://localhost:8080/#/emails/record/<id>
  3. View a detailed view of that email

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

Add a null check so it doesn't blindly capture data that may not exist. This was causing an issue where the template wouldn't render if the "parent_type" was null in the database.
@SuiteBot
Copy link

SuiteBot commented Jan 16, 2025

CLA assistant check
All committers have signed the CLA.

@mattlorimer mattlorimer added the Type:Suite7 Issue Spefc to SuiteCRM 7 that should be in the SuiteCRM 7 repo label Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type:Suite7 Issue Spefc to SuiteCRM 7 that should be in the SuiteCRM 7 repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants