Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I get this warning when I upgraded my site from 6.x-3.3 to 6.x-3.4.
Suggested fix attached.
Comment | File | Size | Author |
---|---|---|---|
filefield-missing-argument-filefield-view-access.txt | 517 bytes | bengtan |
Comments
Comment #1
TallDavid CreditAttribution: TallDavid commentedComment moved to http://drupal.org/node/829890.
Comment #2
bengtan CreditAttribution: bengtan commented@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.
Comment #3
TallDavid CreditAttribution: TallDavid commentedChanging priority back to Normal since the relevant issue was moved. Sorry for the chaos.
Comment #4
denniemans CreditAttribution: denniemans commentedI just updated to 6.x-3.4, and I've got the same problem. How can I fix this, please help
Comment #5
Sera CreditAttribution: Sera commented#1 fixed the problem. The warning disappeared. Thank you.
Comment #6
tomsm CreditAttribution: tomsm commentedMe too, after updating to 6.x-3.4 I get the same error.
#1 fixes it. Thanks!
Comment #7
lordzik CreditAttribution: lordzik commentedThe 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
Comment #8
mariomaric CreditAttribution: mariomaric commentedAttached patch works for me too, tnx!
Comment #9
kriskhaira CreditAttribution: kriskhaira commentedAlso works for me. Attention newbies, if you don't know how to patch, please go here: http://drupal.org/patch/apply
Comment #10
espie CreditAttribution: espie commentedLooking at older 3.3 release shows a default $node=NULL in the function... works equally well.
Comment #11
Nchase CreditAttribution: Nchase commentedpatch works fine, thx!
Comment #12
psmith CreditAttribution: psmith commentedThanks 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.
Comment #13
GiorgosKpatch above clears warnings (after a clear cache)
Comment #14
Jochem CreditAttribution: Jochem commentedworked fine for me. thx!
Comment #15
nathanjo CreditAttribution: nathanjo commentedpatch works fine for me. thanks
Comment #16
nicholasThompsonI 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...
Comment #17
j0nathan CreditAttribution: j0nathan commentedNo more error in the watchdog after applying patch in #0.
(subscribing)
Comment #18
benjaminlhaas CreditAttribution: benjaminlhaas commentedYou definitely don't want to use NULL for the $node -- either passing NULL to
filefield_view_access
intheme_filefield_item
, or by defaulting $node to NULL infilefield_view_access
-- becausefilefield_view_access
doesn't check for a NULL node before dereferencing it.Comment #19
zoo CreditAttribution: zoo commentedThe suggested fix at #0 worked, fixing the "warning: Missing argument 2 for filefield_view_access()" problem.
Thanks
Comment #20
liquid06 CreditAttribution: liquid06 commentedThe patch at #0 fixes the error for me as well.
Comment #21
GiorgosKbut when you edit a node with filefield you still get
Comment #22
pwolanin CreditAttribution: pwolanin commented[delete]
Comment #23
hanoiiI got this as well and also tried out the patch and it fixed the warnings.
Comment #24
yan CreditAttribution: yan commentedSame problem, initial patch seems to solve it.
Comment #25
dadderley CreditAttribution: dadderley commentedThanks for the patch.
Comment #26
asb CreditAttribution: asb commentedSame issue. Confirming that the patch from #1 works as advertised.
Comment #27
pwolanin CreditAttribution: pwolanin commentedcommitted to CVS after consulting with quicksketch - rolling a bugfix release shortly.
Comment #28
bengtan CreditAttribution: bengtan commented@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.
Comment #29
Crappie101.com CreditAttribution: Crappie101.com commentedAttached patch worked for me.
Comment #30
dadamo CreditAttribution: dadamo commentedAck! 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.
Comment #31
quicksketchdadamo: Lightbox needs to be updated. See #831774: Fix for missing argument error after upgrading to Filefield 6.x-3.5.
Comment #32
dadamo CreditAttribution: dadamo commentedSweet! 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!
Comment #33
ressa CreditAttribution: ressa commentedImageField was disabled after the upgrade... I had to re-enable it after updating FileField to 6.x-3.5