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.
After migrating a site to a server with php 5.3, I'm getting the following warning:
Notice: Trying to get property of non-object in filefield_field_sanitize() (line 294 of /var/aegir/platforms/live/systemseed-6.x-1.20.3/profiles/systemseed/modules/contrib/filefield/filefield_field.inc).
Comment | File | Size | Author |
---|---|---|---|
#3 | 1164892-filefield-sanitize.patch | 585 bytes | mrfelton |
Comments
Comment #1
mrfelton CreditAttribution: mrfelton commentedShould probably also note that this is with pressflow.
Comment #2
mrfelton CreditAttribution: mrfelton commentedThis seems to be a conflict with the Realname module. Disabling that module resolves the issue. Looking at backtrace shows that realname's implementation of
content_profile_load_profile()
cals.
This looks like a valid way to call
content_format()
whose signature looks like so:So, content_format then calls filefield_file_sanitze with a NULL node object (the following is from content_format):
$node is null because it wan't passed to
content_format()
. Should filefield_field_sanitize() be able to deal with a NULL node object, since content_format may pass one to it? Or, is content_format at fault here?Comment #3
mrfelton CreditAttribution: mrfelton commentedHere is a patch that gets rid of the warning by first checking if the node object is valid before trying to use it to set the nid property. I don't know if this would have any side effects, but it seems to be working for me.
Comment #4
pydubreucq CreditAttribution: pydubreucq commentedHi,
I had this error too after migrate to Pressflow and this patch works for me ;)
Bye
Comment #5
mikeytown2 CreditAttribution: mikeytown2 commentedpatch #3 works for me as well.
Comment #6
quicksketchThanks guys. Although it accommodating for other naughty modules it works for me.