Ticket #3994 (closed Patches: fixed)

Opened 3 years ago

Last modified 3 years ago

Show current context on Extension page - Custom Context Module

Reported by: IgorG Assigned to:
Priority: minor Milestone: 2.8
Component: Custom Context Version: 2.5-branch
Keywords: Cc:
Confirmation: Unreviewed Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

This patch makes select field show correct current context on page load in Custom Context module

Attachments

functions.inc.php.patch (2.2 kB) - added by IgorG on 01/02/10 13:08:29.
Patch for Custom Context 0.3.4
install.sql (4.3 kB) - added by kenn10 on 03/10/10 13:37:03.
Updated install.sql to reflect correct version number on custom-contexts screen in FreePBX

Change History

01/02/10 13:08:29 changed by IgorG

  • attachment functions.inc.php.patch added.

Patch for Custom Context 0.3.4

(follow-up: ↓ 2 ) 02/27/10 16:34:32 changed by p_lindheimer

  • summary changed from Show current context on Extension page to Show current context on Extension page - Custom Context Module.

(in reply to: ↑ 1 ) 03/10/10 11:18:06 changed by kenn10

Replying to p_lindheimer: This patch has fixed the issue of the selected custom-context not remaining "pinned-up" on the extensions screen. I'm running FreePBX 2.7.0.0 on Asterisk 1.6.2.6-RC2.

(follow-up: ↓ 4 ) 03/10/10 13:19:54 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to fixed.

(In [9116]) fixes #3994 current context on extension page not sticking

(in reply to: ↑ 3 ) 03/10/10 13:34:29 changed by kenn10

  • status changed from closed to reopened.
  • resolution deleted.

Replying to p_lindheimer:

(In [9116]) fixes #3994 current context on extension page not sticking

03/10/10 13:37:03 changed by kenn10

  • attachment install.sql added.

Updated install.sql to reflect correct version number on custom-contexts screen in FreePBX

(follow-up: ↓ 15 ) 03/10/10 15:14:56 changed by p_lindheimer

please apply this patch and tell me if it rectifies this problem, I would prefer to have the information pulled out properly from the source...

Index: functions.inc.php
===================================================================
--- functions.inc.php   (revision 9116)
+++ functions.inc.php   (working copy)
@@ -3,12 +3,26 @@
 
 //used to get module information
 function customcontexts_getmodulevalue($id) {
-       global $db;
+global $db;
+
+switch ($id) {
+  case 'moduledisplayname':
+    $module_info = module_getinfo('customcontext');
+    return($module_info['customcontext']['name']);
+    break;
+
+  case 'moduleversion':
+    $module_info = module_getinfo('customcontext');
+    return($module_info['customcontext']['version']);
+    break;
+
+  default:
        $sql = "select value from customcontexts_module where id = '$id'";
        $results = $db->getAll($sql);
        if(DB::IsError($results)) 
                $results = null;
        return isset($results)?$results[0][0]:null;
+  }
 }
 
 //used to get module information

03/10/10 15:16:36 changed by p_lindheimer

(In [9121]) fixes module version reporting by pulling the version out of the proper place, waiting for feedback prior to publishing re #3994

(follow-up: ↓ 8 ) 03/15/10 14:12:46 changed by dpk

Hi there,

I'm not sure if this relates, but I'm using FreePBX 2.7.0.0 with Asterisk 1.4.22 and just updated to Custom Context 0.3.5

When I now try to change the context of an existing Extension I get the following error:

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 55 in /var/www/freepbx/admin/modules/customcontexts/functions.inc.php on line 440

Even when I change back to any other context the error resists.

As Line 440 is asks MySQL

$curcontext = mysql_result(mysql_query($query), 0);

I guess it's possible it's related.

Thanks for your Help! dennis

(in reply to: ↑ 7 ; follow-up: ↓ 11 ) 03/15/10 14:20:47 changed by dpk

Replying to dpk:

When I now try to change the context of an existing Extension (only IAX2 ones!) I get the following error:

(follow-up: ↓ 10 ) 03/28/10 20:34:24 changed by kenn10

I tried patch 9121 for functions.inc.php. It does not work. On the custom-contexts main page, you only get "V" for the version number. I patched version 9116 to the 9121 version.

(in reply to: ↑ 9 ) 03/28/10 20:40:31 changed by kenn10

Replying to kenn10:

I tried patch 9121 for functions.inc.php. It does not work. On the custom-contexts main page, you only get "V" for the version number. I patched version 9116 to the 9121 version.

I am not able to duplicate this on my 1.4 or 1.6 Asterisk box running FreePBX 2.7.0.1 with all updates installed. I do not have IAX extensions but have no problem with SIP or DAHDI extensions when I change the custom-context.

(in reply to: ↑ 8 ; follow-up: ↓ 12 ) 03/28/10 20:41:52 changed by kenn10

Replying to dpk:

Replying to dpk:

When I now try to change the context of an existing Extension (only IAX2 ones!) I get the following error:

I am not able to duplicate this on my 1.4 or 1.6 Asterisk box running FreePBX 2.7.0.1 with all updates installed. I do not have IAX extensions but have no problem with SIP or DAHDI extensions when I change the custom-context.

(in reply to: ↑ 11 ; follow-up: ↓ 13 ) 03/29/10 10:35:23 changed by dpk

Replying to kenn10:

Replying to dpk:

Replying to dpk:

When I now try to change the context of an existing Extension (only IAX2 ones!) I get the following error:

I am not able to duplicate this on my 1.4 or 1.6 Asterisk box running FreePBX 2.7.0.1 with all updates installed. I do not have IAX extensions but have no problem with SIP or DAHDI extensions when I change the custom-context.

With Sip extensions I also don't have any problems. After updating everything today I still have custom context 0.3.5 and see a v0.3.2 link in the menu. I've tried "Force Download and Install 0.3.5" but the error on the iax2 extensions still persists. If you could just create an iax2 extension for testing I'd be interested if you can reproduce the error then. Otherwise I'll also try the functions.inc.php patch 9121 you mentioned.

(in reply to: ↑ 12 ) 03/29/10 12:19:49 changed by kenn10

Replying to dpk:

Replying to kenn10:

Replying to dpk:

Replying to dpk:

When I now try to change the context of an existing Extension (only IAX2 ones!) I get the following error:

I am not able to duplicate this on my 1.4 or 1.6 Asterisk box running FreePBX 2.7.0.1 with all updates installed. I do not have IAX extensions but have no problem with SIP or DAHDI extensions when I change the custom-context.

With Sip extensions I also don't have any problems. After updating everything today I still have custom context 0.3.5 and see a v0.3.2 link in the menu. I've tried "Force Download and Install 0.3.5" but the error on the iax2 extensions still persists. If you could just create an iax2 extension for testing I'd be interested if you can reproduce the error then. Otherwise I'll also try the functions.inc.php patch 9121 you mentioned.

OK. On my lab box (Asterisk 1.4.26, FreePBX 2.7.0.1, stock Custom-Contexts v0.3.5) I can add an IAX extension and save it. Then I modify the extension and add one of my custom-contexts, save it and get no issue. Then I update the extension again and choose another custom-context and again have no errors.

On my production Asterisk 1.6.2.6, FreePBX 2.7.0.1, patched Custom-Contexts v0.3.5, the same applies. I added an IAX extension, saved it, modded it several times with no errors. If you are convinced this is related to Custom-Contexts, uninstall the module and re-install to see if this helps. Its sounds more like you have a database issue that is not related to custom-contexts. Try deleting one of the IAX extensions and adding a new one and see if the same error occurs.

03/29/10 12:43:28 changed by p_lindheimer

for those seeing the wrong version number displayed, did you apply the above patch? It is not checked in yet pending some feedback.

(in reply to: ↑ 5 ) 03/31/10 09:14:32 changed by kenn10

I fixed the module name in this patch and that allows the correct version number to show on all custom-contexts screens.

Replying to p_lindheimer:

please apply this patch and tell me if it rectifies this problem, I would prefer to have the information pulled out properly from the source...

Index: functions.inc.php
===================================================================
--- functions.inc.php   (revision 9116)
+++ functions.inc.php   (working copy)
@@ -3,12 +3,26 @@
 
 //used to get module information
 function customcontexts_getmodulevalue($id) {
-       global $db;
+global $db;
+
+switch ($id) {
+  case 'moduledisplayname':
+    $module_info = module_getinfo('customcontexts');
+    return($module_info['customcontexts']['name']);
+    break;
+
+  case 'moduleversion':
+    $module_info = module_getinfo('customcontexts');
+    return($module_info['customcontexts']['version']);
+    break;
+
+  default:
        $sql = "select value from customcontexts_module where id = '$id'";
        $results = $db->getAll($sql);
        if(DB::IsError($results)) 
                $results = null;
        return isset($results)?$results[0][0]:null;
+  }
 }
 
 //used to get module information

04/19/10 14:54:48 changed by kenn10

Philippe -

I believe with all the patches rolled in, this should make a stable 0.3.6 version release for the Custom-Contexts module with the disclaimer that it only works up to version 2.7 of FreePBX and not beyond.

04/19/10 16:57:59 changed by p_lindheimer

  • milestone changed from Cut Line to 2.8.

ok moved this into this Milestone so I don't space it and we'll get these rolled into a new module soon.

05/07/10 01:00:08 changed by p_lindheimer

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [9591]) closes #3994 get proper version, don't allow installation on 2.8, update help links, provide warning about End of Life potential

06/16/10 15:58:30 changed by p_lindheimer

(In [9844]) fixes #3994 properly, previous fix assumed sip and created errors in many cases, also adds custom_contexts_check_destinatinos() function un-tested

06/17/10 16:01:48 changed by p_lindheimer

  • component changed from Other Module to Custom Context.