signalpoint / DrupalGap

An application development kit for Drupal websites.
https://www.drupalgap.org
GNU General Public License v2.0
231 stars 185 forks source link

Fails to load jQuery when a core locale language file isn't present, but a custom one is #611

Open bmason opened 8 years ago

bmason commented 8 years ago

I'm using cordova 5.1.1

I get a run time error: Failed to load resource file:///android_asset/www/jquery-1.9.1.min.js send @ jquery-1.9.1.min.js:5

index.html loads fine with Chrome - no cordova.js

index.html

<!DOCTYPE html>

Fab Card ```

Fab Card

Fab Card
```
signalpoint commented 8 years ago

@bmason I hate to ask such a simple question, but.... is the jquery-1.9.1.min.js file present in your app's www directory?

bmason commented 8 years ago

Yes, and loads with chrome.

I tried a test js along side just as a sanity check.

Best guess, my drupal/phone gap stack is hosed. :/

bmason commented 8 years ago

desperation cordova platorm rm android cordova platorm add android

it did change behavior:

HEAD file:///android_asset/www/locale/th.json b.ajaxTransport.send @ jquery-1.9.1.min.js:5b.extend.ajax @ jquery-1.9.1.min.js:5drupalgap_file_exists @ drupalgap-7.x-1.2.min.js:24drupalgap_load_locales @ drupalgap-7.x-1.2.min.js:21drupalgap_bootstrap @ drupalgap-7.x-1.2.min.js:10_drupalgap_deviceready @ drupalgap-7.x-1.2.min.js:7Channel.fire @ cordova.js:821(anonymous function) @ cordova.js:229

seems jquery is not loading because Thai (th.json) is not in www/locale

Thai translation in www/app/my_module/locale is working fine.

bmason commented 8 years ago

Copying th.json into www/locale allows jQuery to load.

signalpoint commented 8 years ago

@bmason Interesting, thank you for digging into this. It sounds like this could be a bug with DrupalGap, in that if there is a custom locale file, and no corresponding core local file, then we may get some load problems.

bmason commented 8 years ago

Seems so. This resolved the problem I was having with build also.

signalpoint commented 8 years ago

@bmason Thanks for clarifying, I'll leave this open until I get a fix into core.