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

Suggested fix attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TallDavid’s picture

bengtan’s picture

Priority: Normal » Critical

@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.

TallDavid’s picture

Priority: Critical » Normal

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

denniemans’s picture

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

Sera’s picture

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

tomsm’s picture

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

lordzik’s picture

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

mariomaric’s picture

Attached patch works for me too, tnx!

kriskhaira’s picture

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

espie’s picture

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

Nchase’s picture

patch works fine, thx!

psmith’s picture

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.

GiorgosK’s picture

Status: Active » Reviewed & tested by the community

patch above clears warnings (after a clear cache)

Jochem’s picture

worked fine for me. thx!

nathanjo’s picture

patch works fine for me. thanks

nicholasThompson’s picture

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...

j0nathan’s picture

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

benjaminlhaas’s picture

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.

zoo’s picture

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

liquid06’s picture

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

GiorgosK’s picture

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.
pwolanin’s picture

[delete]

hanoii’s picture

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

yan’s picture

Same problem, initial patch seems to solve it.

dadderley’s picture

Thanks for the patch.

asb’s picture

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

pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

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

bengtan’s picture

@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.

Crappie101.com’s picture

Attached patch worked for me.

dadamo’s picture

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.

quicksketch’s picture

dadamo’s picture

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!

ressa’s picture

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

Status: Fixed » Closed (fixed)

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