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?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | link_class_not_found_3335174_4.patch | 821 bytes | brooke_heaton |
Issue fork content_notification-3335174
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
Comment #4
brooke_heaton commentedPatch created from repo fork Merge Request. Adds use Drupal\Core\Link; to Controller.
https://git.drupalcode.org/project/content_notification/-/merge_requests...
Comment #5
brooke_heaton commentedPatch provided by pratik_specbee.
Comment #6
manish.upadhyay commentedFixed as part of https://www.drupal.org/project/content_notification/releases/8.x-2.5
Comment #7
manish.upadhyay commented