Hi !

I'm trying to figure out how to the ethercalc module is working. I'm trying to setup the information in the "host" field in the ethercalc option screen but I got this error messages:

 Warning : file_get_contents(): Unable to find the wrapper "localhost" - did you forget to enable it when you configured PHP? dans drupal_build_js_cache() (ligne 4943 dans /var/www/drupal7/includes/common.inc).
    Warning : file_get_contents(localhost://mysitename.something:8000/socket.io/socket.io.js#): failed to open stream: No such file or directory dans drupal_build_js_cache() (ligne 4943 dans /var/www/drupal7/includes/common.inc).
    Warning : file_get_contents(): Unable to find the wrapper "localhost" - did you forget to enable it when you configured PHP? dans drupal_build_js_cache() (ligne 4943 dans /var/www/drupal7/includes/common.inc).
    Warning : file_get_contents(localhost://mysitename.something:8000/zappa/zappa.js#): failed to open stream: No such file or directory dans drupal_build_js_cache() (ligne 4943 dans /var/www/drupal7/includes/common.inc).
    Warning : file_get_contents(): Unable to find the wrapper "localhost" - did you forget to enable it when you configured PHP? dans drupal_build_js_cache() (ligne 4943 dans /var/www/drupal7/includes/common.inc).
    Warning : file_get_contents(localhost://mysitename.something:8000/static/md5.js#): failed to open stream: No such file or directory dans drupal_build_js_cache() (ligne 4943 dans /var/www/drupal7/includes/common.inc).
    Warning : file_get_contents(): Unable to find the wrapper "localhost" - did you forget to enable it when you configured PHP? dans drupal_build_js_cache() (ligne 4943 dans /var/www/drupal7/includes/common.inc).
    Warning : file_get_contents(localhost://mysitename.something:8000/player/broadcast.js#): failed to open stream: No such file or directory dans drupal_build_js_cache() (ligne 4943 dans /var/www/drupal7/includes/common.inc).
    Warning : file_get_contents(): Unable to find the wrapper "localhost" - did you forget to enable it when you configured PHP? dans drupal_build_js_cache() (ligne 4943 dans /var/www/drupal7/includes/common.inc).
    Warning : file_get_contents(localhost://mysitename.something:8000/player/main.js#): failed to open stream: No such file or directory dans drupal_build_js_cache() (ligne 4943 dans /var/www/drupal7/includes/common.inc).

When I leave this field empty there is not such error messages but ethercalc sharing functionality is not working.

Thanks !
Lionel

Comments

infojunkie’s picture

The Sheetnode+Ethercalc integration was created as a proof-of-concept a couple of years ago. Since then, Ethercalc has diverged greatly and more work is needed to bring them back in sync.

When the proof of concept was done, here's how it worked:

The basic idea is to install and invoke Etheralc

npm i -g ethercalc
ethercalc

Then, the sheetnode_ethercalc module includes the relevant Ethercalc JS files when it loads the spreadsheet. From then on, the sharing functionality should work.

If anyone on this thread is interested to pursue this, please let me know and I can provide support and guidance.

crazedspeed’s picture

I would love to work on this with your guidance.

infojunkie’s picture

Great! Thanks for offering your help, crazedspeed. First thing to do is to get Ethercalc to work on its own (Ethercalc contains its own version of the SocialCalc spreadsheet engine).

Next, we need to evaluate the current sheetnode_ethercalc module against the latest Ethercalc code. I am in touch with Ethercalc's author and maintainer, so we can get her help if the Ethercalc code is hard to decipher.

crazedspeed, we can use this thread to follow your progress.

crazedspeed’s picture

I have the current version of Ethercalc up and running without issues. I see that the sheetnode module is pointing toward some js files. The issue here is I am new to drupal modules. I don't see any code in sheetnode pointing toward these js files. In the code I was checking out by Audrey it showed the js files pointing to the ethercalc server.

infojunkie’s picture

The function sheetnode_ethercalc_sheetnode_plugins() in sheetnode_ethercalc.module (you need to grab the latest 7.x-1.x-dev) has a bunch of drupal_add_js() calls to add the relevant js files.

Dharsh’s picture

Any update on this issue ? My project requires me to use Sheetnode in collaborative mode . So I am trying to figure out how ethercalc works. I installed ethercalc and was able to run it without any issues. Then I created a sheetnode in drupal and saved it and then opened it in edit mode. I opened the same sheet in another browser and edited it but could not find the edits being done in the other browser. Sharing functionality is not working . I noticed that in the ethercalc logs , there is a comment "serving static content socket-io.js" . But I could not find the other required js files being served to the client.

Any help in this issue would be appreciated!! :)

Thanks,
Dharsh

mattia.cristallo’s picture

I have the same problem.
Failed to open stream: socket.io.js
Failed to open stream: zappa.js
Failed to open stream: md5.js
Failed to open stream: broadcast.js
Failed to open stream: main.js
and sheetnode's page load very slow.
Some help please?

schasoli’s picture

Hi and thanks for the module! It is handy.
Of cource it would be even nicer with ethercalc support. But the Sheetnode_EtherCalc module seems not to be used. I can rename it to sheetnode_ethercalc.module.back and there is no difference. Therfore its no wonder ethercalc itself gives no output.

Well, I am using a standard installation of
drupal 7.26
Sheetnode 7.x-1.x-dev
ethercalc with redis server up ( multiedit works, tested with localhost:8000)
Sheetnode_EtherCalc modul is activated and configured with localhost 8000

at sheetnode_ethercalc.module Line 26-30 I find this
drupal_add_js($ethercalc_path . '/socket.io/socket.io.js#', array('weight' => 10));
drupal_add_js($ethercalc_path . '/zappa/zappa.js#', array('weight' => 10));
drupal_add_js($ethercalc_path . '/static/md5.js#', array('weight' => 10));
drupal_add_js($ethercalc_path . '/player/broadcast.js#', array('weight' => 10));
drupal_add_js($ethercalc_path . '/player/main.js#', array('weight' => 10));

trying localhost:8000/socket.io/socket.io.js# and all the others seem to work:
/*! Socket.IO.min.js build:0.9.16, production. Copyright(c) 2011 LearnBoost MIT Licensed */ ....

when testing all I get is a Warning: Invalid argument supplied for foreach() in sheetnode_node_validate() (line 678 of /var/www/drupal-7.26/sites/all/modules/sheetnode/sheetnode.module).
This seems to be the standard behavier if no multiedit is avalible.

so where could I start searching? who calls it?

infojunkie’s picture

@schasoli, sheetnode_ethercalc is activated when editing a spreadsheet. That's when the function sheetnode_ethercalc_sheetnode_plugins() should be called to add the JS files that you mention. You can make sure this is happening by insert a dsm() statement at the top of that function.

I think the warning you're seeing is unrelated. In any case, I will commit a fix to prevent the warning.

  • Commit b18e7a1 on 7.x-1.x by infojunkie:
    Prevent warning on validating nodes without fields #2113069
    
schasoli’s picture

the warning might be OK. I only get it when testing multiedit.
1. Opening one sheetnode in two browsers and change some content
2. saving in browser one ->OK
3. saving in broser two -> not possible, because content changed -> warning

schasoli’s picture

thanks for your quick response anyway.
I put a dsm() on top and right below drupal_add_js($ethercalc_path . '/player/main.js#', array('weight' => 10)); script and funktion is called when editing a spreadsheet.

schasoli’s picture

there is is small bug at modul configuration:
Home » Administration » Configuration » Content authoring » Sheetnode
when EtherCalc host is not empty but for example 'test',
$ethercalc_path -> test://localhost:8000 instead of http://test:8000
I tried a rewrite. But at this point this is a minor issue:
maybe change from line 15 so https://test would be a possible URL.
(for unknowen reason variable_get does not pick up the default)

    $ethercalc_host = variable_get('sheetnode_ethercalc_host', '');
    $ethercalc_port = variable_get('sheetnode_ethercalc_port', '8000');
    if (empty($ethercalc_port)){ 
		$ethercalc_port = 8000;
	}
    if ( empty($ethercalc_host)) {
		$ethercalc_host = $GLOBALS['base_url'];
		$ethercalc_host = preg_replace('/(:\\/\\/[^\\/]+).*/', '$1', $ethercalc_host, 1);
	}
    $ethercalc_path =  $ethercalc_host.":".$ethercalc_port;
    dpm('ethercalc_path: '.$ethercalc_path);

when everything left empty everything is OK.

dsm($ethercalc_path . '/socket.io/socket.io.js#') -> http://localhost:8000/socket.io/socket.io.js#
if I put the URL direktly in the browser there is ethercalc response.

so
drupal_add_js($ethercalc_path . '/player/main.js#', ...); becomes
drupal_add_js(http://localhost:8000/socket.io/socket.io.js#, ...);

P.S. some edits

ramak.psg@gmail.com’s picture

Hi schasoli,

Did you get this working post this point ? I am in the same situation (ethercalc multi edit works, but sheetnode multi edit wont)
Also, did you find any alternatives ?

Regards,
Ramakrishnan

amstel’s picture

In my case I can load the javascript files and have the ethercalc server serving static content, however, the console displays an error in a socket.io call. The server path looks wrong but I could not find where in the ethercalc source code my drupal basepath is being appended to it.

[09:50:08.981] GET http://myserver.com/http://myserver.com:8000/socket.io/1/?t=1400572208361 [HTTP/1.1 404 Not Found 8690ms]

I have tried with both blank and filled up server input in drupal module configuration and nothing works.

jochba’s picture

Hi Karim

Do you still want help with this? I have ethercalc working behind a reverse proxy but it looks like that's a little too complicated for this stage, when I get a direct connection I'll have a better look at what's going on. Was the proof-of-concept a usable system? Do you have any idea what sort of commitment/knowledge would be necessary to get this working?

Thanks

jatobá-1’s picture

Hi Ramak,

I'm trying to run sheetnode + ethercalc on OA 2 - Drupal 7 solution but I'm running in the same problem you pointed: ethercalc multi edit works, but sheetnode multi edit wont

The ethercalc server is not the same that hosts the drupal server. I believe that something related to the socket.io path, but we still don't figure out where we need to fix this issue. Some etherpad files like player.ls use some replace in the path but maybe change this cause other side effects.

Someone have any tips?

  • infojunkie committed b18e7a1 on 7.x-2.x
    Prevent warning on validating nodes without fields #2113069