The Converting 4.7 modules to 4.8/HEAD guide shows that hook_view() needs to return $node, but this is not used in node_example_view for HEAD

Comments

lyricnz’s picture

In fact (of course) the example is largely 4.7 sample code, the other changes in this area aren't quite up-to-date. I'd submit new code, but this is Day Three for me :)

webchick’s picture

Component: Misc » Documentation in CVS

I think that's awesome that you're on day 3 and are already comfortable submitting issues. Keep it up! :D

In case you're feeling extra spunky ;) (or for anyone else for that matter), here's how to fix this:

1. Take a checkout of the contrib/docs directory from contributions HEAD
2. Find the file docs/developer/examples/node_example.module.
3. Copy it to the modules directory in a ">Drupal HEAD test site you have
4. Tweak it until it works ;)
5. Make a patch, submit it here, and mark the issue "code needs review."

Then one of the developer-type folks can test it out, verify that it works, and get it applied to the API docs. :)

lyricnz’s picture

Okay, I'll do that as a learning excercise, but node_example.module doesn't appear to contain any hook_view implementations :)

But I did find a bug in Comment module and Upload module (which I was using to discover how to update the example code)! http://drupal.org/node/80891

lyricnz’s picture

I've updated node_example.module and submitted as http://drupal.org/node/80894

But that's not related to this issue, which is about http://api.drupal.org/api/head/function/node_example_view being out-of-date (compared to CVS head, and the converting-to-4.8 doc)

lyricnz’s picture

Status: Active » Fixed

Documentation appears to be updated. Closing.

Anonymous’s picture

Status: Fixed » Closed (fixed)