i want to limit node reference (autocomplete widget) based on one of CCK field on current node. So, i made view to limit results and in argument->Provide default argument->PHP Code. And write code like this:
$mynode = node_load(arg(1)); return $mynode->field_foo['nid'];
But problem is in that arg(1) is not returning NID of current page but string 'autocomplete' (i guess it is name of function). (Didn't had luck with menu_get_object() either)
So how can i get NID of current node other than using ARG() in views custom PHP argument?
Can i reference directly on CCK field (yes, as I sad it is on samo page as autocomplete text-field)?
Thanks for help.
UPDATE: This is specific to autocomplete widget.
It works well with other widget types (select list, checkbox...)