Download & Extend

warning: Missing argument 2 for filefield_view_access()

Project:FileField
Version:6.x-3.5
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I get this warning when I upgraded my site from 6.x-3.3 to 6.x-3.4.

Suggested fix attached.

AttachmentSize
filefield-missing-argument-filefield-view-access.txt517 bytes

Comments

#1

Priority:normal» critical

Comment moved to http://drupal.org/node/829890.

#2

@1: I think your issue is related to #829890: 6.x-3.4 Not Appearing in Available Updates, namely that 6.x-3.4 hasn't appeared in the available releases information yet. It's unrelated to the original post.

#3

Priority:critical» normal

Changing priority back to Normal since the relevant issue was moved. Sorry for the chaos.

#4

I just updated to 6.x-3.4, and I've got the same problem. How can I fix this, please help

#5

#1 fixed the problem. The warning disappeared. Thank you.

#6

Me too, after updating to 6.x-3.4 I get the same error.
#1 fixes it. Thanks!

#7

Priority:normal» critical

The same errors appears for me after upgrade to 3.4.

Fix from #1 seems to work.

Please release new version with patches from #1 and http://drupal.org/node/829920 #10

#8

Attached patch works for me too, tnx!

#9

Also works for me. Attention newbies, if you don't know how to patch, please go here: http://drupal.org/patch/apply

#10

Looking at older 3.3 release shows a default $node=NULL in the function... works equally well.

#11

patch works fine, thx!

#12

Thanks for this, the patch worked for me as well. However have had some problems with the filefield_sources module on top of this!

Just as a matter of interest in the drupal developers community do modules which rely on other modules get notified before updates are released? I have come accross a few fire fighting releases and am a bit confused as to why these things get missed.

As a drupal newbie I work under a rule of thumb that security patches should be implemented ASAP but this sort of puts me off doing so.

#13

Status:active» reviewed & tested by the community

patch above clears warnings (after a clear cache)

#14

worked fine for me. thx!

#15

patch works fine for me. thanks

#16

I also found setting it to NULL worked equally well. NULL would probably be marginally more efficient too, although I don't know what the security implications are...

#17

No more error in the watchdog after applying patch in #0.
(subscribing)

#18

You definitely don't want to use NULL for the $node -- either passing NULL to filefield_view_access in theme_filefield_item, or by defaulting $node to NULL in filefield_view_access -- because filefield_view_access doesn't check for a NULL node before dereferencing it.

#19

The suggested fix at #0 worked, fixing the "warning: Missing argument 2 for filefield_view_access()" problem.
Thanks

#20

The patch at #0 fixes the error for me as well.

#21

but when you edit a node with filefield you still get

warning: Missing argument 2 for filefield_edit_access() in sites\all\modules\filefield\filefield.module on line 486.

#22

[delete]

#23

I got this as well and also tried out the patch and it fixed the warnings.

#24

Same problem, initial patch seems to solve it.

#25

Thanks for the patch.

#26

Same issue. Confirming that the patch from #1 works as advertised.

#27

Status:reviewed & tested by the community» fixed

committed to CVS after consulting with quicksketch - rolling a bugfix release shortly.

#28

@21:

I got this warning too (for filefield_edit_access, NOT filefield_view_access) initially. Clearing the site cache fixed it. I think the cache for the menu items just needed flushing.

#29

Attached patch worked for me.

#30

Version:6.x-3.4» 6.x-3.5

Ack! I have a multisite drupal install with drupal 6.17 and I have updated to filefield 6.x 3.5 which contains the patch info listed above, but I am still getting the following warning error:

warning: Missing argument 2 for filefield_view_access(), called in /var/www/html/sites/all/modules/lightbox2/lightbox2.formatter.inc on line 262 and defined in /var/www/html/sites/all/modules/filefield/filefield.module on line 497.

I have done the following:

Put site in offline mode
delete -filefield from sites/all/moduldes/
upload - filefield 6.x 3.5
flush caches
run update.php
run cron.php
flush caches again
and I get the warning error.

If I revert back to filefield 3.3 it works fine, but then I get the security error.

#31

#32

Sweet! That did the trick.
Most appreciated. I was so hung up on the filefield issue, I hadn't thought about looking into lightbox patches. I did look to see if there was a lightbox update.

Thank you!

#33

ImageField was disabled after the upgrade... I had to re-enable it after updating FileField to 6.x-3.5

#34

Status:fixed» closed (fixed)

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