I&#39;m writing a module that adds a field to the create/edit forms for nodes of certain types - the actual types can be chosen by the user. There are loads of ways to identify the type of the current node from within hook_form_alter(), but is there an accepted standard way to do it?<div>

<br></div><div>If I use $form[&#39;type&#39;][&#39;#value&#39;] I get &quot;Notice: Undefined variable&quot; warnings as my local server&#39;s error reporting is very verbose. I know I could change the error reporting level, but surely it&#39;s better practice to try and kill the bug?</div>

<div><br></div><div>And if I use $form_id I have to use nodetype_node_form and convert it to nodetype - and, as an aside, I can&#39;t find a PHP function to do this cleanly.</div><div><br></div><div>So, what&#39;s the accepted way to do this?<br clear="all">

--<br>Google Talk/Windows Live Messenger/AIM: <a href="mailto:james.benstead@gmail.com">james.benstead@gmail.com</a><br>Yahoo! Messenger/Twitter/IRC (Freenode): jim0203<br>Jabber: <a href="mailto:jim0203@jabber.org">jim0203@jabber.org</a> // ICQ: 7088050<br>

Skype: jimbenstead<br> <br>
</div>