Error on Content Notification Screen

Created on 20 January 2023, almost 2 years ago
Updated 27 January 2023, almost 2 years ago

Problem/Motivation

After adding a content notification, the listing screen would WSOD. On debug, following issue was seen:
Error: Class 'Drupal\content_notification\Controller\Link' not found in Drupal\content_notification\Controller\ContentNotificationController->getContentNotificationList() (line 65 of modules/contrib/content_notification/src/Controller/ContentNotificationController.php).

Steps to reproduce

Install module on Drupal 9.4.5, add new notification:
Any content type
Triggers on Add/Update
Triggers by any user group
Recipients limit: -1
Recipient list: manual to any email
Email Subject: content updated - [node:title]
Email body: Hello, A new or updated page is available at: [node:url] Many Thanks

Proposed resolution

Looking at line 65 of ContentNotificationController.php uses Link class without adding the correct line at the top.
Adding 'use Drupal\Core\Link;' after Line 10

I am not sure what other impact this will have in the module, could someone with more familiarity of this module take a look and confirm/test this issue?

🐛 Bug report
Status

Fixed

Version

2.4

Component

Code

Created by

🇬🇧United Kingdom kevin-oyster

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