[development] $node namespace woes -- can we fix this in D6?

Peter Wolanin pwolanin at gmail.com
Thu May 31 21:50:12 UTC 2007


This would be a little awkward at times, but seems like a nice
solution because it's enforced at the level of the node module.

-Peter

> On 31 May 2007, at 10:42 PM, Derek Wright wrote:
>
>
>
>
>
> right, i saw that and appreciate it.  however, i'm talking about a more
> drastic, core-wide purge of directly touching $node, not just fixing up the
> collision with book and path.  perhaps that's too ambitious for D6...
> Doesn't nodeapi still use the $additions array ?
>
> couldn't we get away with changing how it merges the data?
>
> function node_invoke_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
>   $return = array();
>   foreach (module_implements('nodeapi') as $name) {
>     $function = $name .'_nodeapi';
>     $result = $function($node, $op, $a3, $a4);
>     if (isset($result) && is_array($result)) {
>  // one line change here. Gets rid of an array_merge too.
>       $return[$name] = $result;
>     }
>     else if (isset($result)) {
>       $return[] = $result;
>     }
>   }
>   return $return;
> }
>
> obviously,the big work is changing everywhere that accesses the node object.
> And that goes all the way down to the theme layer.
>
>


More information about the development mailing list