[development] node_get_types() D5 and php5

Carl Mc Dade carl_mcdade at yahoo.com
Wed Feb 14 17:35:37 UTC 2007


Well, I don't want to get into a big thing about this but they both say that they return arrays. When in actual use 5.0 returns an object. At least PHP thinks so if you use gettype().

4.7) "An array consisting ('#type' => name) pairs".

5.0) "Either an array of all available node types, or a single node type, in a
variable format".

This should probably go over to the documentation list for correction. But do they have control over  core comments? 
 
 Carl Mc Dade
____________________________
Web Developer



 



----- Original Message ----
From: Earl Miles <merlin at logrus.com>
To: development at drupal.org
Sent: Wednesday, February 14, 2007 5:19:52 PM
Subject: Re: [development] node_get_types() D5 and php5

Carl Mc Dade wrote:
> 
> 
> "The |node_get_names()| function no longer exists. Please use 
> |node_get_types('name', $node)| instead. Similarly, the 
> |node_get_base()| function no longer exists. Please use 
> |node_get_types('module', $node)| instead."
> 
> Which did not apply to my situation since it was already there in the 
> code. In the api there is no mention of a change in the functions 
> behavior either. Previously I was getting the right behaviour by just 

Really? Compare:

http://api.drupal.org/api/4.7/function/node_get_types

to

http://api.drupal.org/api/head/function/node_get_types

The return value is notably different.

I realize not every single detail is covered in the updating modules page, but 
the change IS documented in the api.








 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070214/d869e7af/attachment.htm 


More information about the development mailing list