Active
Project:
DruCall
Version:
7.x-2.2
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Apr 2015 at 22:07 UTC
Updated:
23 Apr 2015 at 13:17 UTC
Jump to comment: Most recent
Hi,
I have been trying to set up Drucall for its video capabilities on my pantheon.io website. I have downloaded and installed the module and all of its dependencies, but I keep getting this error whenever I try to enable the Drucall module:
Parse error: syntax error, unexpected '[' in */sites/all/modules/drucall/drucall.module on line 59
Line 59 of drucall.module is:
foreach ([ "jssip", "jscommunicator", "arbiterjs", "jqueryi18nproperties", "fontawesome" ] as $libname) {
The section of code looks like this:
function drucall_call() {
global $language;
// Make sure the necessary jQuery UI components are available on
// the page, Drupal loads core jQuery automatically but not jQuery UI
drupal_add_library('system', 'ui.draggable');
drupal_add_library('system', 'ui.resizable');
// We use the `libraries' module to load javascript dependencies:
foreach ([ "jssip", "jscommunicator", "arbiterjs", "jqueryi18nproperties", "fontawesome" ] as $libname) {
if (!($library = libraries_detect($libname))) {
$error = "failed to load an essential component";
$error_msg = "failed to load $libname - please install it (check the DruCall instructions)";
}
if($library && empty($library['installed'])) {
$error = $library['error'];
$error_msg = $library['error message'];
}
if(isset($error)) {
drupal_set_message($error_msg, $error, FALSE);
return $error;
}
libraries_load($libname);
}
Any help would be appreciated in resolving this.
Thanks!
Comments
Comment #1
pocock commentedWhich PHP version are you using?
Can you please describe your server environment, e.g. are you using Debian or Ubuntu on a server with Drupall packages, or did you self-install Drupall?
Comment #2
lattice commentedSorry,
I'm using Pantheon.io, which is a hosting/development environment for drupal, so I don't know whether they are running a debian or ubuntu system. It is running PHP version 5.3.29 in a linux server environment. It had an auto install for Drupal.
Hope that helps!
Thanks
Comment #3
pocock commentedPlease open the developer console in your browser and go to the tab for monitoring network activity.
Reload the page with DruCall on it.
Look in the network activity logs and see if it is loading each JavaScript file correctly. Look for any errors suggesting that some of the files failed to load.
Please also look in the other tabs of the developer console for any errors or clues.
Comment #4
lattice commentedI tried going to the module page where I am having trouble enabling drucall, but was unable to find any JS errors when trying to enable it. Since it won't allow me to enable it, I can't go to the drucall config page to test there. It says all of my required JS files are enabled.
When I copy my libs folder from this pantheon site over to a localhost (running php PHP 5.5.9-1ubuntu4.9 (cli) ) test site, I can enable drucall with no errors. Does this mean there's a problem with my pantheon site setup?
Thanks,
Lattice