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?

CommentFileSizeAuthor
#4 link_class_not_found_3335174_4.patch821 bytesbrooke_heaton
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kevin-oyster created an issue. See original summary.

_pratik_ made their first commit to this issue’s fork.

brooke_heaton’s picture

StatusFileSize
new821 bytes

Patch created from repo fork Merge Request. Adds use Drupal\Core\Link; to Controller.

https://git.drupalcode.org/project/content_notification/-/merge_requests...

brooke_heaton’s picture

Status: Active » Needs review

Patch provided by pratik_specbee.

manish.upadhyay’s picture

Status: Needs review » Fixed
manish.upadhyay’s picture

Status: Fixed » Closed (fixed)