hook_nodeapi(&$node, 'load') should return an array
KiamLaLuno - July 19, 2008 - 16:16
| Project: | Nodewords |
| Version: | 6.x-1.0-rc1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Like stated in the documentation:
Return value
This varies depending on the operation.The "presave", "insert", "update", "delete", "print" and "view" operations have no return value.
The "load" operation should return an array containing pairs of fields => values to be merged into the node object.
That is not what the module does, which uses code like:
<?php
case 'load':
$node->nodewords = _nodewords_load('node', $node->nid);
break;
?>
#1
btw, path.module (a Core module!) has the same behaviour:
<?phpcase 'load':
$path = 'node/'. $node->nid;
$alias = drupal_get_path_alias($path, $language);
if ($path != $alias) {
$node->path = $alias;
}
break;
?>
#2
Yes, but it's a core module; if there would be a change on the way that hook is handled, the core module would be updated as well.
That is different from the case where a third party module has code that could be incompatible with future versions of Drupal; as the author of the module doesn't make new versions of the Drupal core, there would be some incompatibilities with new versions of Drupal. That is what the Drupal documentation warns about.
#3
Fixed in CVS. Thanks!
#4
Automatically closed -- issue fixed for 2 weeks with no activity.