I have install freepbx 15 with Debian 10 and I have a problem with the custom contexts module (version 15.0.17.25) :
Whoops\Exception\ErrorException Use of undefined constant allow - assumed ‘allow’ (this will throw an Error in a future version of PHP)
I submit a ticket the 24/02/21 and wait for the fix.
As we are on May and I have some time to spend on it, I take a look to the program functions.inc.php. It seems a classical error with php 7.2 and more. I think the error is a lack of parenthesis.
The correct syntax has to be :
if (is_numeric($val[‘allow’])) {
$timegroup = $val[‘allow’];
} else {
if ($val[‘allow’] <> ‘yes’) {
$userules = $val[‘allow’];
}
}
if (is_numeric($val[‘sort’])) {
$sort = $val[‘sort’];
I make the modification and it seems to work on my server. I just get a security warning : normal.
I have two questions :
Can someone check this new version. I am not sure it is correct in any case.
How to modify the current version of custom contexts to get ride of the security warning and to make other people enjoy this correction?