- Issue created by @nblack69
I have drupal 9.5.3 and php 8.1.16
I get this :The website encountered an unexpected error. Please try again later. TypeError: Drupal\nodeviewcount\Form\NodeViewCountSettingsForm::getRoleNamesOptions(): Argument #1 ($excluded_user_roles) must be of type array, null given, called in /var/www/html/web/modules/contrib/nodeviewcount/src/Form/NodeViewCountSettingsForm.php on line 123 in Drupal\nodeviewcount\Form\NodeViewCountSettingsForm->getRoleNamesOptions() (line 206 of modules/contrib/nodeviewcount/src/Form/NodeViewCountSettingsForm.php).
when i go to /admin/config/content/nodeviewcount
I get when I access "admin/config/content/nodeviewcount"
Drupal 9.5.3
Php 8.1.16Don't understand.. can't make it work.
I have drupal 9.5.3
and php 8.1.16Don't understands... maybe because of Drupal or php?
Drupal 9.5.3 and php 8.1.16- 🇮🇳India shashank5563 New Delhi
I am able to reproduce the issue.
Message TypeError: Drupal\nodeviewcount\Form\NodeViewCountSettingsForm::getRoleNamesOptions(): Argument #1 ($excluded_user_roles) must be of type array, null given, called in /modules/contrib/nodeviewcount/src/Form/NodeViewCountSettingsForm.php on line 123 in Drupal\nodeviewcount\Form\NodeViewCountSettingsForm->getRoleNamesOptions() (line 206 of /modules/contrib/nodeviewcount/src/Form/NodeViewCountSettingsForm.php)
I am using following PHP,Drupal and db
Step to reproduce issue:
1. Following Configuration needed.
Drupal Version: 9.5.0
PHP Version: 8.1.9
Database Version: 10.8.3-MariaDB2. I have install the module
3. Then try to access following URL: admin/config/content/nodeviewcount
4. Getting the issue. - 🇮🇳India shashank5563 New Delhi
I have made some changes in code. after fixing the code it is working fine.
- Status changed to Needs review
over 1 year ago 8:24am 21 April 2023 - 🇷🇺Russia adci_contributor
Thank you for your help!
I was unable to repeat this problem with Drupal 9.5.11 and PHP 8.1.18. But everyone who has encountered the issue can try flush caches, uninstall and install the module again. If that doesn't help, this patch will be a good solution.
- 🇺🇦Ukraine Kostiantyn
On Drupal version: 10.2.3, MariaDB version: 10.4, and PHP version: 8.1, everything is working fine. I was able to reproduce the error on Drupal version 9.5.0, but the patch from @shashank5563 successfully resolves it.
- Status changed to RTBC
9 months ago 12:05pm 5 March 2024 - 🇺🇦Ukraine Kostiantyn
I tested the patch from @shashank5563 on Drupal 9.5.11. The error has disappeared.