POST: "http://sach.dev/?q=drupalgap/system/connect.json" not found
1. Add language to drupalgap.pages.inc #line: 12
function drupalgap_status() {
- drupal_add_js(array('drupalgap' => array('services_endpoint_default' => base_path() . "?q=drupalgap/")), 'setting');
// FIX Multilanguage Site
+ global $language;
+ $lang_code = $language->language;
+ if ($lang_code == LANGUAGE_NONE) {
+ // Add drupalgap javascript settings to Drupal settings.
+ drupal_add_js(array('drupalgap' => array('services_endpoint_default' => base_path() . "?q=drupalgap/")), 'setting');
+ } else {
+ // Add drupalgap javascript settings to Drupal settings.
+ drupal_add_js(array('drupalgap' => array('services_endpoint_default' => base_path() . "?q=$lang_code/drupalgap/")), 'setting');
}
// Add drupalgap javascript.
drupal_add_js(drupal_get_path('module', 'drupalgap') . '/drupalgap.js');
2. Change default language in mobile-application/app/settings.js at #line: 28
// The Default Language Code
Drupal.settings.language_default = 'en';
3. Download https://www.easystreet3.com/sites/default/files/jdrupal/jdrupal-7.x-1.2.js and copy file jdrupal-7.x-1.2.js" to "mobile-application/jdrupal-7.x-1.2.js"
4. Modify jdrupal-7.x-1.2.js at #line: 1234 by adding +Drupal.settings.language_default+"/"
// Build the Request, URL and extract the HTTP method.
var request = new XMLHttpRequest();
var url = Drupal.settings.site_path +
Drupal.settings.base_path + '?q='+Drupal.settings.language_default+"/";
// Use an endpoint, unless someone passed in an empty string.
if (typeof options.endpoint === 'undefined') {
url += Drupal.settings.endpoint + '/';
}
else if (options.endpoint != '') {
url += options.endpoint + '/';
}
5. Change mobile-application/index.html at line: 18 by change jdrupal-7.x-1.2.min.js to jdrupal-7.x-1.2.js
<!-- jDrupal -->
<script type="text/javascript" charset="utf-8" src="jdrupal-7.x-1.2.js"></script>
6. Test Connection Fail but the mobile-app will run.
Comments
Comment #1
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedIt sounds like jDrupal needs to be expanded to support multilingual sites that use the language code prefix on the front of the path(s).
Comment #2
tyler.frankenstein CreditAttribution: tyler.frankenstein commented