Hello,
I have an issue with using Location CCK and Automatic Nodetitles 7.x-1.0. I am trying to set the title to the location name using the code below but it fails and I get the error message below, seems like the location is not saved when automatic node titles is calling in. My location is well saved in the node tho and I do see it in my Gmap. I originally used the location core module in the node instead of the CCK and it worked fine.. Any idea?

<?php
  print $node->field_location[0]['city'];
?>

Notice: Undefined offset: 0 in eval() (line 2 of C:\inetpub\vhosts\fussyfrenchy.co.uk\httpdocs\sites\all\modules\auto_nodetitle\auto_nodetitle.module(211) : eval()'d code).

Comments

svidot’s picture

up

ankur’s picture

Status: Active » Closed (fixed)

I think you might need to use

$node->field_location[LANGUAGE_NONE][0]['city'];

It's a fields API thing for having separate values per field. LANGUAGE_NONE is the default that assumes that the values for your field are language neutral. I think its a macro for the string 'und'

svidot’s picture

Thanks dude!! can't imagine how much time I spent on this..