Devel cannot run image_access() correctly as another user (or any content-type module that implements _access incorrectly), so node access information is wrong about Image nodes.
Fix is to use the $account param, and use that if? provided. User in this following thread said $account is required in D6, so maybe use it no matter what instead of using $user or $account as i did?

Here is thread that led to this conclusion:
http://drupal.org/node/309765#comment-1017973

Thanks,
Arian

Comments

salvis’s picture

Please run Coder on Image — it will reveal this as well as a number of other obvious D6 porting issues that need to be fixed before it makes sense to start testing.

sun’s picture

Version: 6.x-1.0-alpha3 » 6.x-1.0-alpha4
Status: Active » Needs review
StatusFileSize
new1.08 KB

Please test attached patch.

sun’s picture

Title: Devel cannot determine correct access, image_access() should be fixed » hook_access() changed in 6.x
StatusFileSize
new1.03 KB

Revised patch after reading the docs properly.

sun’s picture

Status: Needs review » Fixed

Committed.

salvis’s picture

Status: Fixed » Needs review
StatusFileSize
new591 bytes

Since you're accessing $account->uid, $account must not be NULL.

EDIT: patch relative to current HEAD.

sun’s picture

Status: Needs review » Needs work

I do not think so - the API docs do not contain this enhanced validation either, so $account is always passed in. All I mistakenly left over from my first patch was the wrong default, i.e. "= NULL" in the signature.

salvis’s picture

Ah, right, I didn't check the API docs, only looked at your code.

The docs say that $account is not optional, so just remove the = NULL and that's it.

sun’s picture

Status: Needs work » Fixed

Removed.

Status: Fixed » Closed (fixed)

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