Hi,
I'm running a CVS version of Drupal (so have E_NOTICE enabled). On every page, the breadcrumb builder for some reason is checking the access hook for swfupload, and because there's no sid etc (or POST at all), swfupload_access() is raising an E_NOTICE error.
Also, the name of this function conflicts with hook_access(), although that's not an issue unless you're declaring a custom node type. All the same, probably less confusing to not risk that.
I've attached a patch that fixes the errors and renames the function to swfupload_upload_access.
Thanks
Comments
Comment #1
skilip commentedHey, thanks for the patch. You're right about the hook_access conflict. I'm surprised this hasn't been noticed before. After changing the name to swfuploaf_upload_access(), is your problem not already solved? I mean, is the !empty() statement still needed?
Comment #2
neilnz commentedWell yes, in theory you still need it. In the case where there is no sid parameter in $_POST for instance, if ($p->sid) will throw an E_NOTICE, whereas if (!empty($p->sid) won't. You could also use if (isset($p->sid) if you prefer.
I found this access hook was being called on every page load by the breadcrumb building function, but I'm not quite sure why. Here's the backtrace from an ordinary page request with nothing at all to do with swfupload:
Comment #3
skilip commentedThanks nielnz!
Comment #4
skilip commentedAdded in BETA5