Mentions module, check for value

Created on 12 January 2023, over 1 year ago
Updated 1 March 2023, over 1 year ago

Problem/Motivation

This may not be a bug, and may be my installation, but I have a comment entity that has a text field that is not used in the form display. This means that when the comment entity form is submitted, this text field is always null. The mentions module takes a look at the entity to get a list of all the text fields (including the one that is always going to be NULL), and tries to use the value of the field. This is when my site falls over.

Steps to reproduce

Have a comment entity with a text field that is not used in the edit form display.

Proposed resolution

Check whether the value is NULL before using it:

-    if ($filter_mentions->shouldApplyFilter()) {
+    if ($filter_mentions->shouldApplyFilter() && ($value)) {
🐛 Bug report
Status

Fixed

Version

11.7

Component

Code (back-end)

Created by

🇬🇧United Kingdom RhiP

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.69.0 2024