So on creating a new NAT node, after having the body field mapped to the description field these two errors pop up if the body field is left blank:
Notice: Undefined offset: 0 in _nat_field_associate() (line 704 of /Users/jnettik/Sites/lead_and_learn/website/site/sites/all/modules/contrib/nat/nat.module).
Notice: Undefined offset: 0 in _nat_field_associate() (line 705 of /Users/jnettik/Sites/lead_and_learn/website/site/sites/all/modules/contrib/nat/nat.module).
It seems _nat_field_assoicate() assumes the body will always be filled out. Here's a small patch that seems to fix it for me.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | nat_term_description_empty_body_post_patch.png | 208.17 KB | brooke_heaton |
| #2 | nat_save_term_description_empty_node_body.png | 272.69 KB | brooke_heaton |
| #2 | nat_settings_term_description_node_body_association.png | 188.28 KB | brooke_heaton |
| nat-undefined-offset.patch | 792 bytes | jnettik |
Comments
Comment #1
iainh commentedPatch doesn't suppress the PHP Notice for me. The body is filled out in the content type whose Title is to become the new term in every case that the Notice is generated to me. NAT is configured to take the term from the title and the term description from a different field added to the content type: namely "Short description"
Comment #2
brooke_heaton commentedConfirmed. Error when node with empty body is saved when NAT Field Association is Term->Description = Node->Body.
Comment #3
brooke_heaton commentedPatch works as intended. Error no longer displays if body is empty.
Comment #5
brooke_heaton commentedComment #6
brooke_heaton commented