Custom contexts module : error with php7

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?

You should be able to submit your code update on git.freepbx.org, logging in using the same credentials you use on this forum.

By submitting your update there your code will receive review by developers.

I get connected to git.freepbx.org.
I go to customcontext. And then how to submit the new code?

The Custom Contexts module is community supported, so all are encouraged to identify issues and code fixes.

Confirmed, pull requests can be made to git.freepbx.org. Before code contributions can be accepted from any user, they must file a CLA Sangoma Documentation

I sent the CLA one week ago. Is it normal that I receive no answer?

Hey,

I usually process those. What email address did you send it to? It should go to [email protected]

Matthew Fredrickson

It is the adress I use

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.