[development] $node namespace woes -- can we fix this in D6?
adrian rossouw
adrian at bryght.com
Thu May 31 20:53:34 UTC 2007
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070531/8fa86bbf/attachment.htm
More information about the development
mailing list