Clean minimal installation.

Accessing Default Call configuration menu item:

Fatal error: Call to a member function execute() on a non-object in C:\vhosts\Drupal\voip_1_0\sites\all\modules\voipdrupal\modules\voipscriptui\voipscriptui.module on line 16

I have enabled VoipTwilio. Error accessing VOIP server configuration menu item.

Fatal error: Class 'VoipTwilioServer' not found in C:\vhosts\Drupal\voip_1_0\sites\all\modules\voipdrupal\modules\voiptwilio\voiptwilio.module on line 17

CommentFileSizeAuthor
#6 patch.txt1.19 KBjs

Comments

Syntapse’s picture

Attempting to access VOIP scripts in main menu:

Fatal error: Call to a member function execute() on a non-object in C:\vhosts\Drupal\voip_1_0\sites\all\modules\voipdrupal\modules\voipscriptui\voipscriptui.module on line 16

freescholar’s picture

Just a few questions about your setup:

Did you make sure that Twilio is selected as the default server in your Default Server Configuration within the VoIP Drupal Administrative settings?

Do you have Views installed and enabled?
You need Views to see the Voipscripts.

Also -check for typos in your Inbound and Outbound Tokens

To troubleshoot, you can install Tropo VoIP Drupal modules and set up a tropo.com account (free) and see if you get the same errors.

js’s picture

I have this error testing with Tropo.

Yes, Views is installed.

I am confused by the query in
\sites\all\modules\voipdrupal\modules\voipscriptui\voipscriptui.module on line 16
if this is what we are wishing to change to D7
//$query = db_select('node', n.title FROM {node} n WHERE n.type = :n.type and n.status = :n.status', array(':n.type' => "voipscriptui", ':n.status' => 1));

I don't understand the join here,
$query = db_select('node', 'n')
->join('title', 'n', ':n.type = voipscriptui :n.status = 1', array(':n.type' => "voipscriptui", ':n.status' => 1));
or the syntax. Isn't there a missing "AND" between the conditions?

The object error goes away with this
$query = db_select('node', 'n');
$query->join('title', 'n', ':n.type = voipscriptui :n.status = 1', array(':n.type' => "voipscriptui", ':n.status' => 1));

which gives
SELECT FROM {node} n
INNER JOIN {title} n_2 ON :n.type = voipscriptui :n.status = 1

as a suggestion:

$query = db_select('node', 'n');
$query
->fields('n', array('title'));
->condition('n.type', 'voipscriptui')
->condition('n.status', '1');

yields:

SELECT n.title AS title FROM {node} n WHERE (n.type = :db_condition_placeholder_0) AND (n.status = :db_condition_placeholder_1)

which seems to work for the "foreach" that follows

This should work fine too:
->fields('n')

js’s picture

I should mention that the query appears to run three times. I am not sure why. It could be cached, but if this only runs as an admin function , then it likely doesn't matter very much.

ben.bunk’s picture

Based on a first pass review your suggestion makes sense. I haven't opened the D6 code to verify the original intent but based on what was in the comment in the coder conversion it appears correct:

$query = db_select('node', 'n');
$query
->fields('n', array('title'));
->condition('n.type', 'voipscriptui')
->condition('n.status', '1');

JS - Please put this change into a patch so we can get it tested and I'll commit it to the repo.

Thank you,
Ben

*Copy and Paste Patch Directions for VoIP Drupal can be found here - http://drupal.org/node/1072578/git-instructions

js’s picture

StatusFileSize
new1.19 KB

Sorry, but I have not submitted a patch before, and I have not worked with git.

Also, there appear to be more errors in the D7 code and I just wanted to test voipdrupal, so I abandoned D7 and switched to D6.

I am interested in pursuing this for a project that is important to me, and would really need to the D7 port. As such, I would be willing to help but learning all of the code is more than I can undertake. I would be happy to debug and also to contract for some help.

I have attached a patch file which I made using diff -u. Does this help/work?

tamerzg’s picture

Status: Active » Fixed

I rewrote the query to a D7 version. This error should be fixed now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.