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.

Comments

iainh’s picture

Patch 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"

brooke_heaton’s picture

Confirmed. Error when node with empty body is saved when NAT Field Association is Term->Description = Node->Body.

Screenshot of NAT Settings with Term Description mapped to Node Body

Screenshot of NAT error when saving node without a body

brooke_heaton’s picture

Patch works as intended. Error no longer displays if body is empty.

Screenshot of node save without error on empty node body after patch

  • jnettik authored 6e32d60 on 7.x-2.x
    #1743298 by jnettik, brooke_heaton: Notice: Undefined offset: 0 in...
brooke_heaton’s picture

Status: Needs review » Reviewed & tested by the community
brooke_heaton’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.