wrong path with javascript ivr

Bug #660563 reported by Riccardo Magliocchetti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
WikiPBX
Fix Committed
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.

Revision history for this message
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
Revision history for this message
Riccardo Magliocchetti (riccardo) wrote :

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

Revision history for this message
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
Revision history for this message
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,

Revision history for this message
Riccardo Magliocchetti (riccardo) wrote :

Thanks, latest trunk shows the full absolute path.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.