Thanks for pointing this out. I'll try to fix this as soon as possible. In the mean time, please check out the developer's guide if you're interested in attempting this fix:
I noticed that my DrupalGap add content type forms were not working at all. They would say 'undefined' in my test app and in Ripple. The following error would be returned in Ripple:
image_fields_present_on_entity_type - TypeError: Cannot read property 'length' of undefined drupalgap.js
_drupalgap_form_render_elements - TypeError: Cannot read property 'nid' of undefined drupalgap.js
I traced this back to image_fields_present_on_entity_type having my content type as 'pop-song' instead of 'pop_song' so when drupalgap_field_info_instances was called it would return null because the node object listed my content type as 'pop_song.'
I see the second error in _drupalgap_form_render_elements is caused by form.bundle having hyphens (in my case).
Have either of you solved this issue yet. I believe I am running into the same issue with "_" in the bundle name. I am trying to add giftcard purchase support to drupal gap and get a very similar error when trying to load the add to cart form. Giftcard purchases require the commerce_line_item bundle giftcard_purchase. When the app tries to load the add to cart form I get the following error:
"_drupalgap_form_render_elements - TypeError: Cannot read property 'submit' of undefined"
Funny thing is if I remove the submit button from the add to cart form this error goes away and the form generates as expected. Without the submit button.
Comments
Comment #1
lifeinpoetry commentedComment #2
tyler.frankenstein commentedThanks for pointing this out. I'll try to fix this as soon as possible. In the mean time, please check out the developer's guide if you're interested in attempting this fix:
http://www.drupalgap.org/node/194
Thanks!
Comment #3
tennist commentedComment #4
tennist commentedI noticed that my DrupalGap add content type forms were not working at all. They would say 'undefined' in my test app and in Ripple. The following error would be returned in Ripple:
I traced this back to image_fields_present_on_entity_type having my content type as 'pop-song' instead of 'pop_song' so when drupalgap_field_info_instances was called it would return null because the node object listed my content type as 'pop_song.'
I see the second error in _drupalgap_form_render_elements is caused by form.bundle having hyphens (in my case).
Hopefully this is enough info to fix this bug.
Comment #5
tennist commentedHave either of you solved this issue yet. I believe I am running into the same issue with "_" in the bundle name. I am trying to add giftcard purchase support to drupal gap and get a very similar error when trying to load the add to cart form. Giftcard purchases require the commerce_line_item bundle giftcard_purchase. When the app tries to load the add to cart form I get the following error:
"_drupalgap_form_render_elements - TypeError: Cannot read property 'submit' of undefined"
Funny thing is if I remove the submit button from the add to cart form this error goes away and the form generates as expected. Without the submit button.
Comment #6
tyler.frankenstein commented