FreePBX-ContributedModules / dynroute

GNU General Public License v3.0
1 stars 3 forks source link

Undefined variable $id #9

Closed vigh-barnabas closed 3 months ago

vigh-barnabas commented 3 months ago
| dynroute            | 17.0.3.1  | Enabled | GPLv3+      | Sangoma   |
| framework           | 17.0.19.1 | Enabled | GPLv2+      | Sangoma   |

I got the following error when i run fwconsole reload -vvv What could be the problem?

In functions.inc.php line 107:

  [Whoops\Exception\ErrorException (2)]
  Undefined variable $id

Exception trace:
  at /var/www/html/admin/modules/dynroute/functions.inc.php:107
Whoops\Run->handleError() at /var/www/html/admin/modules/dynroute/functions.inc.php:107
dynroute_get_config() at /var/www/html/admin/libraries/BMO/DialplanHooks.class.php:97
FreePBX\DialplanHooks->processHooks() at /var/www/html/admin/libraries/Console/Reload.class.php:323
FreePBX\Console\Command\Reload->reload() at /var/www/html/admin/libraries/Console/Reload.class.php:95
FreePBX\Console\Command\Reload->execute() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Command/Command.php:312
Symfony\Component\Console\Command\Command->run() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:1022
Symfony\Component\Console\Application->doRunCommand() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:314
Symfony\Component\Console\Application->doRun() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:168
Symfony\Component\Console\Application->run() at /var/lib/asterisk/bin/fwconsole:163
kguptasangoma commented 3 months ago

Error is coming due to dynroute module so if you do not need remove this module or else raise jira under dynroute module for freepbx contributed section.

kguptasangoma commented 3 months ago

https://github.com/FreePBX-ContributedModules/dynroute/issues

vigh-barnabas commented 3 months ago

I need dynroute and I see that the module produces the error. The link you provided shows this github repo.

I wanted the know if it's a know issue or it's a problem for freePBX 17 and are there any fixes for this?

kguptasangoma commented 3 months ago

Dynroute is a community contributed module hence shared link to that repo for you to raise issue there so someone from community can help to fix that issue.

1soproni commented 3 months ago

Hi @kguptasangoma You shared exactly the same link of this repo we are talking. Could you please double check the link?

johnfawcett commented 3 months ago

Hi I'm the author of Dynamic Routes. The module is now in the freepbx contributed modules repository but I plan to continue supporting it. I have tried to reproduce this issue, but on my installation the fwconsole relaod command is working. One point is that my configuration is fully updated and has framework version 17.0.19.5. Could you update to that version and reverify?

1soproni commented 3 months ago

Hi @johnfawcett

vigh-barnabas and me work at the same company. I just updated all the modules but the issue is still persist. How could we investigate further?

johnfawcett commented 3 months ago

Hi no need to investigate it further. I have been able to reproduce it. I'll make a fix for it.

johnfawcett commented 3 months ago

Bug fix created and submitted https://github.com/FreePBX-ContributedModules/dynroute/pull/10/commits/f510612cc3b28f6c1887e61f3747791d92f5fdc7

Additionally to this fix in Dynamic Routes, while debugging the issue I found a typo in a Freebpx file which creates a further error:

--- /var/www/html/admin/libraries/extensions.class.php.orig 2024-08-23 18:09:47.329957584 +0200 +++ /var/www/html/admin/libraries/extensions.class.php 2024-08-23 17:48:50.144377102 +0200 @@ -1569,7 +1569,7 @@ class ext_mysql_fetch extends extension { var $fetchid; var $resultid;

Both fixes are needed to get the reload to work.

1soproni commented 3 months ago

Should we fix them manually or will be updates in the next some days?

johnfawcett commented 3 months ago

It can't harm to fix manually, but you will get warnings about the manual alterations. I'll leave @kguptasangoma to comment about time fixes will come into a released package.

kguptasangoma commented 3 months ago

dynroute v17.0.3.2

johnfawcett commented 3 months ago

Just one further update. It's correct that this issue in dynroute is closed. There remains the issue in extensions.class.php from Freepbx framework. I have submitted a pull request. I did it against the default 16 branch but it needs to go into 17.0 too. Let me know if I should submit a separate pull request for 17.0. Without the patch in extensions.class.php the fwconsole reload fails with a different error.

See issue https://github.com/FreePBX/framework/issues/153