The version of node_access_example.module for Drupal 6 that is currently publicly available ("Version 1.1 (checked in on 2009/10/03 at 14:35:27 by rfay)") appears to be for the Drupal 7 API instead of for the Drupal 6 API (in D6, there is only one hook_nodeapi() instead of a hook for each operation). This is very mis-leading for newbies and makes it difficult to understand how to write a node access module for Drupal 6.

Comments

rfay’s picture

You're surely right. Let's see if we can sort this out.

jhodgdon’s picture

Project: Drupal core » Examples for Developers
Version: 6.16 » 6.x-1.x-dev
Component: documentation » Node Access Example

Moving to correct queue

rfay’s picture

Status: Active » Postponed (maintainer needs more info)

Actually, I'm not able to figure out what you mean - please help me.

The D6 version of the node_access_example.module in http://drupal.org/project/examples has hook_perm(), the D6 version.

The version on the API site: http://api.drupal.org/api/drupal/developer--examples--node_access_exampl..., has hook_perm(), the D6 version.

Can you help me understand with some links or something? Or perhaps the API site had a glitch?

I should mention too, @Guy, that your participation here is welcome. Patches are solicited. And the node_access.module needs an update to D7 (and probably other help). And it needs tests.

rfay’s picture

rfay’s picture

Status: Postponed (maintainer needs more info) » Active

OK, so it has hook_perm(), but it has it in the D7 format. And all the rest of your comments are right.

We've never even worked on this one, but somehow got a partially-converted D7 version in here in the initial copy. I'm not even sure if we have the original D6 version around now, so perhaps will have to work backward. Use the private module?

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new4.19 KB

Here's the relevant rollback to the latest version that was in contributions/docs/examples.

dave reid’s picture

StatusFileSize
new4.25 KB

Better patch with a few cleanups.

rfay’s picture

Issue tags: +Needs tests
StatusFileSize
new3.7 KB

With slight changes, and now it works - one more D7-ism removed.

Thanks so much for the archaelogy, davereid. Finally we get this cleaned up.

It still needs tests and a going-over, but at least it won't be there just confusing people any more.

rfay’s picture

Status: Needs review » Fixed

Wow, thanks Dave. Finally got this cleaned up. Committed to DRUPAL-6--1

http://drupal.org/cvs?commit=405846

Status: Fixed » Closed (fixed)
Issue tags: -Needs tests

Automatically closed -- issue fixed for 2 weeks with no activity.