- First commit to issue fork.
- @emclaughlin opened merge request.
- Status changed to Needs review
almost 2 years ago 6:10pm 10 February 2023 - πΊπΈUnited States emclaughlin
I added a quick check that $configEnabled isn't empty.
In php 8, there is code in the .module file that results in possible nulls sent to inarray.
VAPN installed in drupal 9.3 with php 8.1. Go to any page after install whilst not logged in, and the error message shows:
The website encountered an unexpected error. Please try again later.
TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 113 of modules/contrib/vapn/vapn.module).
This error message goes away once the vapn has been configured to a particular type on the page /admin/config/vapn/vapnconfig
The line the error refers to is
if (empty($node->getType()) || !in_array($node->getType(),$configEnabled,TRUE)) {
The format of in_array is: in_array(mixed $needle, array $haystack, bool $strict = false)
Thus, haystack is $configEnabled is empty at the initial state of this install and should be checked within this line.
Needs review
1.5
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I added a quick check that $configEnabled isn't empty.