Hello

I face the following errors when using the Mobile App from an Android mobile (Samsung Galaxy Note, Gingerbread.xxla6)
error on login as administrator
-->
drupalgap_service_resource_extract_results - TypeError: Cannot read property 'length' of undefined

errors when creating new content:
-->
drupalgap_field_info_instances - TypeError: Cannot read property 'node' of undefined
node_edit_form - TypeError: Cannot read property 'length' of undefined
drupal_gap_form_render - TypeError: Cannot read property 'elements' of null

error when viewing content
-->
on startup a list of recently added content is displayed. Clicking a node title though, results in a blank page. No errors displayed, no matter what access rights the user has.

additional info:
--> This test site runs on .local
--> suspected modules that I deactivated without effect: form block, arrange fields
--> System Connect Status: "The system connect test was successful, DrupalGap is configured properly!"

Thanks for looking into this.
Charles

Comments

andrewchosen’s picture

I'm having the exact same issue. Glad I'm not alone, and I hope somebody can help us. I'll post if I can find anything.

tyler.frankenstein’s picture

Assigned: Unassigned » tyler.frankenstein
Status: Active » Needs review

Please update your site's DrupalGap module to the 7.x-1.x-dev version. That should fix it, please let me know if that works, thank you!

andrewchosen’s picture

That's the version I'm using I think. 7.x-1.2+8-dev

tyler.frankenstein’s picture

OK, please use http://jsfiddle.net/ (if possible) to place the JSON results when using FireFox Poster to POST to this example url (replace with your domain of course):

http://www.example.com/drupalgap/drupalgap_system/connect.json

andrewchosen’s picture

Okay, after the update to DrupalGap you pushed today, I don't seem to be getting the "drupalgap_service_resource_extract_results - TypeError: Cannot read property 'length' of undefined" error, but content still doesn't appear when selecting it from the front page.

Here is the jfiddle as requested: http://jsfiddle.net/CQzZ8/

andrewchosen’s picture

Okay, I monitored the log while loaded on an Android Virtual Device and every time I open a node, this error shows up in LogCat:

03-02 03:33:13.903: E/Web Console(826): Uncaught TypeError: Cannot read property '0' of undefined at file:///android_asset/www/node.html:37

tyler.frankenstein’s picture

Alrighty, making progress. Next up, try using FireFox Poster to retrieve one of your nodes, for example do a GET with FireFox Poster on:

http://www.example.com/drupalgap/node/123.json

I'd then examine those results against this file to see if anything comes to mind that might be 'undefined': https://github.com/signalpoint/DrupalGap/blob/7.x-1.x/scripts/node.js

While monitoring the log in AVD, did you see a call to retrieve the node at all? The URL would be similar to the one above. If not, then it is failing to make the call to drupalgap.services.node.retrieve.call in the pageshow event.

andrewchosen’s picture

The only values I see that are 0 are tnid, sticky, cid, and comment_count

It does seem to make the call, because I see it gather all of the node information in LogCat. I did notice something strange, though. One a node that wasn't given a description, I can see the comment area on the mobile app. On my site, I use PHP to generate the node title from the description. So why would a node with no title or description show the comment area?

tyler.frankenstein’s picture

Status: Needs review » Closed (fixed)

The 7.x-1.x-alpha branch has fixed many problems mentioned here. Please update to that version. If you continue to experience problems here, please describe it in detail and re-open the ticket. Otherwise, just create a new ticket, thanks!

Ivo.Radulovski’s picture

Component: Android App in Google Play » Ripple Emulator in Chrome
Issue summary: View changes

Hello! In my case I use ripple and I can't see the node body at all - that is what I get in the chrome console:

ripple :: Environment Warming Up (Tea. Earl Gray. Hot.) ripple.js:37
GET http://www.familien-hilfe.at/mobile-application/config.xml 404 (Not Found) ripple.js:50
cordova :: Initialization Finished (Make it so.) ripple.js:37
The key "target-densitydpi" is not supported. (index):7
cordova :: fired deviceready event! ripple.js:37
Calling LP_setval from A onloadwff.js:78
Calling LP_setval from A onloadwff.js:78
Calling LP_setval from A onloadwff.js:78
3
Calling LP_setval from A onloadwff.js:78
2
Calling LP_setval from A onloadwff.js:78
3
Calling LP_setval from A onloadwff.js:78
Calling LP_setval from A onloadwff.js:78
POST: http://www.familien-hilfe.at/?q=drupalgap/system/connect.json jdrupal-7.x-1.0-rc2.min.js:22
200 - OK jdrupal-7.x-1.0-rc2.min.js:23
GET: http://www.familien-hilfe.at/?q=drupalgap/views_datasource/drupalgap_con... jdrupal-7.x-1.0-rc2.min.js:22
200 - OK jdrupal-7.x-1.0-rc2.min.js:23
GET: http://www.familien-hilfe.at/?q=drupalgap/node/3.json jdrupal-7.x-1.0-rc2.min.js:22
node_access - TypeError: Cannot read property 'uid' of undefined drupalgap.js:7824
GET: http://www.familien-hilfe.at/?q=drupalgap/node/3.json jdrupal-7.x-1.0-rc2.min.js:22
GET: http://www.familien-hilfe.at/?q=drupalgap/node/3.json jdrupal-7.x-1.0-rc2.min.js:22
200 - OK jdrupal-7.x-1.0-rc2.min.js:23
WARNING: theme_undefined() does not exist drupalgap.js:4481
2
200 - OK jdrupal-7.x-1.0-rc2.min.js:23
entity_load - success - TypeError: Cannot read property 'success' of undefined jdrupal-7.x-1.0-rc2.min.js:12

Help is very much appreciated!

Ivo

Ivo.Radulovski’s picture

Status: Closed (fixed) » Active
Ivo.Radulovski’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
tyler.frankenstein’s picture

Status: Active » Needs review

Did you check your DrupalGap Display Mode in the Drupal UI?

http://www.drupalgap.org/node/184

Also, add this line to the top of your settings.js file to force a fresh reload everytime:

window.localStorage.clear();

Ivo.Radulovski’s picture

yes, i checked the Display Mode - tried serveral modes: default, plain text,...

also added window.localStorage.clear(); to the settings.php

tyler.frankenstein’s picture

This may be related:

https://github.com/signalpoint/DrupalGap/issues/191

Check that out for a possible solution.

Ivo.Radulovski’s picture

does not resolve the issue :(

Now I get:
GET: http://www.familien-hilfe.at/?q=drupalgap/node/3.json jdrupal-7.x-1.0-rc2.min.js:22
2
200 - OK jdrupal-7.x-1.0-rc2.min.js:23
WARNING: drupalgap_entity_get_core_fields - Unknown anonymous comment setting (page): undefined drupalgap.js:6281
GET: http://www.familien-hilfe.at/?q=drupalgap/comment.json&parameters[nid]=3 jdrupal-7.x-1.0-rc2.min.js:22
200 - OK jdrupal-7.x-1.0-rc2.min.js:23
WARNING: theme_undefined() does not exist drupalgap.js:4481
2
Calling LP_setval from A onloadwff.js:78
Calling LP_setval from A onloadwff.js:78
Calling LP_setval from A onloadwff.js:78

Ivo.Radulovski’s picture

Status: Needs review » Active
tyler.frankenstein’s picture

Status: Active » Needs review

Are you running the latest development snapshot of the DrupalGap module and SDK?

www.drupalgap.org/download

Ivo.Radulovski’s picture

Status: Needs review » Active

yes, I've tried both versions - same problem.

tyler.frankenstein’s picture

Status: Active » Needs review

@segments, do you have the core "Comment" module enabled on your Drupal site?

Although it isn't listed as a dependency in drupalgap.info, it is technically a dependency. I think that may be causing the error you are receiving.

Ivo.Radulovski’s picture

Status: Needs review » Active

comment module is active - if you have a look at the app you will see that comments are visible but not the content body: http://www.familien-hilfe.at/mobile-application/

I'll send you an email with additional access data to the website.

Ivo

tyler.frankenstein’s picture

Status: Active » Needs review

@segments, OK, I see what is going on.

Your node has a language code of 'es':

http://www.familien-hilfe.at/?q=drupalgap/node/3.json

Then you'll notice each of the fields on your node have their language code set to 'und'.

I believe this is a bug with the Services module:

https://drupal.org/node/1668422

To get around this, drupalgap_entity_render_field() in the SDK needs to be modified to fall back to 'und' if the field's language code doesn't exist for the node's language code. This needs to be a separate issue, please create it on github.com/signalpoint/DrupalGap to get it resolved.

As for this warning:

WARNING: drupalgap_entity_get_core_fields - Unknown anonymous comment setting (page): undefined

That is unrelated to your node's field display problems, but it appears your page content type may not allow comments for anonymous users, and for some reason it is throwing a warning, but that shouldn't be a problem really.

tyler.frankenstein’s picture

Status: Needs review » Closed (fixed)

@segments, I've fixed this issue. Grab the latest dev snapshot of the SDK for this fix: http://www.drupalgap.org/download

Another user, with a multi-lingual site, was having the same problem, and we were able to fix it.