API page: http://api.drupal.org/api/drupal/modules--field--field.attach.inc/functi...
Describe the problem you have found:
Lack of data format definition. I had a field attached to an entity via the field UI. in the submit function I need to insert data from another form into this field but the entity only had an empty array.
Would be nice if the "$entity->{field name} = array( {language} => array (0 => array('value' => {value to insert})));" was documented. Probably better to put it in the Field API overview.
Comment | File | Size | Author |
---|---|---|---|
#9 | 1373194-d7-link_to_field_language_api-1.patch | 617 bytes | chris.leversuch |
#6 | 1373194-d7-link_to_field_language_api.patch | 535 bytes | chris.leversuch |
#3 | 1373194-link_to_field_language_api.patch | 552 bytes | chris.leversuch |
Comments
Comment #1
jhodgdonThis structure is actually documented on this page:
http://api.drupal.org/api/drupal/modules--field--field.multilingual.inc/...
But it would probably be good if the Field Attach API topic linked to the Field Language topic to indicate this. Good novice project I think?
Comment #2
jhodgdonhttp://api.drupal.org/api/drupal/modules--field--field.attach.inc/group/... is the page that should link to http://api.drupal.org/api/drupal/modules--field--field.multilingual.inc/...
See http://drupal.org/node/1354#links for how to make links with @link.
Comment #3
chris.leversuch CreditAttribution: chris.leversuch commentedSomething like this?
Comment #4
jhodgdonThat link looks fine, yes. Thanks!
Note that this patch will interfere with the patch for #1349610: make the subtopics of Field API link back to it. One of them will need a reroll when the other is committed.
Comment #5
catchLooks good. Committed/pushed to 8.x.
Comment #6
chris.leversuch CreditAttribution: chris.leversuch commentedHere's a D7 version.
I noticed that language didn't have a L - is that a problem?
Comment #7
jhodgdonThis patch is fine. We have differing standards on "Sentence case" vs. "Title Case" in Drupal documentation, and I'm not too particular about enforcing either one.
Comment #8
webchickNo longer applies, most likely due to #1349610: make the subtopics of Field API link back to it.
Comment #9
chris.leversuch CreditAttribution: chris.leversuch commentedHere's a new patch
Comment #10
sven.lauer CreditAttribution: sven.lauer commentedLooks good.
Comment #11
webchickPerfect, thanks!
Committed and pushed to 7.x.