Skip to content

Commit

Permalink
#178. Changed drupalgap_form_load to load the field_info_field and fi…
Browse files Browse the repository at this point in the history
…eld_info_instance instead of doing it in _drupalgap_form_render_element(). They are still attached to the variables by _drupalgap_form_render_element() before sent off to the theme system though.
  • Loading branch information
signalpoint committed Sep 10, 2013
1 parent 68c7975 commit 31d5a06
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions includes/form.inc.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function drupalgap_form_state_values_assemble(form) {
console.log(JSON.stringify(form_state));
}
dpm(form);
dpm(form_state)
dpm(form_state);
return form_state;
}
catch (error) {
Expand Down Expand Up @@ -263,6 +263,8 @@ function drupalgap_form_load(form_id) {
// entity types have their field info attached to the variables object.
if (field_info_field && form.elements.type) {
element_is_field = true;
form.elements[name].field_info_field = field_info_field;
form.elements[name].field_info_instance = drupalgap_field_info_instance(form.entity_type, name, form.elements.type.default_value);
delta = 0;
}
form.elements[name].is_field = element_is_field;
Expand Down Expand Up @@ -373,10 +375,8 @@ function _drupalgap_form_render_element(form, element) {
// field, then attach them both to the variables object so all theme
// functions will have access to that data.
if (element.is_field) {
var field_info_field = drupalgap_field_info_field(name);
var field_info_instance = drupalgap_field_info_instance(form.entity_type, name, form.elements.type.default_value);
variables.field_info_field = field_info_field;
variables.field_info_instance = field_info_instance;
variables.field_info_field = element.field_info_field;
variables.field_info_instance = element.field_info_instance;
}

// If there wasn't a default value provided, set one. Then set the default
Expand Down

0 comments on commit 31d5a06

Please sign in to comment.