New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node_save() in drupalgap #418
Comments
@teripak You'll need to build the field's structure to match what Drupal expects. The easiest way to do that, is to first just create a test node in Drupal through the UI. Then use FireFox poster, to GET the node from this URL:
That will return the JSON structure of the node, examine that structure and take note of how it is built. Then build your field(s) JSON structure in the exact same way. Also, FYI DrupalGap has built in support for creating/editing nodes. Here are some common paths that you can navigate to
Utilizing these features, DrupalGap will automatically build the form for you. |
Thanks it works~ But I needed some modifications to the generated json format.
So I tried to change it and below works without error.
In the above changes, the "[" was removed and 3 items (title, entity_type, bundle) were also not used. Did I do it right? It works anyway.. |
@teripak Correct, I think only the |
I think I am not fully understand about this. Below is what I did.
And I got below errors
The field_start_date is set as a required field and also checked as collect an end date. Do you have any idea what I was wrong? |
@teripak For the date field, the format of the JSON depends on what type of date field you are using, and what type of widget you are using on the date field. For example: |
Hi,
I am learning Drupalgap and it is great for developing app for me who are in the field of web.
I need to use node_save() in drupalgap and I could not find ways to save a node which has a entity reference field and a date field.
There was no error and a node is created successfully. But no data in the field of entity reference and date.
I found a web page as below
http://drupal.aspcode.net/ppst/635472748100189580182694/how-to-update-geofield-using-a-custom-form-and-drupalgaps-nodesave
so I tried to do it with the same way like below but I could not make it.
The text was updated successfully, but these errors were encountered: