Open source web front-end for FreeSWITCH

wrong path with javascript ivr

Reported by Riccardo Magliocchetti on 2010-10-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
WikiPBX
Undecided
Unassigned

Bug Description

Hello,

when you add a javascript ivr the path to the js file is prepended with ".":

<action application="javascript" data="./wikipbx/ivr/torino/prova.js"/>

unfortunately when path does not start with / it is prepended with $FSROOT/scripts:

[ERR] mod_spidermonkey.h:97 Cannot Open File: /usr/scripts/./wikipbx/ivr/torino/prova.js

Documentation (http://wiki.freeswitch.org/wiki/Javascript) says that if the path starts with / will be left untouched so i think it is better to use an absolute path that would work out of the box.

Stas Shtin (stas.shtin) wrote :

Here's how JavaScript IVR path is generated:

http://bazaar.launchpad.net/~wikipbx-dev/wikipbx/trunk/annotate/head%3A/wikipbx/wikipbxweb/models.py#L738

It looks like you've changed settings.INSTALL_SRC to ".", which clearly is wrong - it should be an absolute path. If you haven't changed that setting from default value that auto-detects path based on settings file location, you should set it to correct absolute path.

Changed in wikipbx:
status: New → Invalid

No, i haven't, it is still the default but i don't understand your suggestion: do you mean to hardcode the path?

Stas Shtin (stas.shtin) wrote :

Ok, looks like it was an issue with our settings template file.

Please apply this change to your settings file - http://bazaar.launchpad.net/~wikipbx-dev/wikipbx/trunk/revision/200 . It should fix the issue with the path.

Changed in wikipbx:
status: Invalid → Confirmed
Stas Shtin (stas.shtin) wrote :

Apparently, the problem was caused by the fact that __file__ can be relative or absolute path based on the value from PYTHONPATH that is being used for importing current module - http://groups.google.com/group/comp.lang.python/browse_thread/thread/3b07c2acfa0bff18/c75cd7445990958a?lnk=raot . Now it will be always converted to an absolute path,

Thanks, latest trunk shows the full absolute path.

Stas Shtin (stas.shtin) on 2010-10-20
Changed in wikipbx:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers