Steps to reproduce:

  1. New d7 install (enable profile module)
  2. add new profile field ("Public field, content shown on profile page and on member list pages. ")
  3. give that field a value for a user
  4. navigate to /profile
  5. be saddened by PHP Warning: "Strict warning: Creating default object from empty value in template_preprocess_profile_listing() (line 579 of /.../d7/modules/profile/profile.module)."

The attached patch fixes this issue with a quick if->then

Note: this error was discovered during development of profile tests at #479220: Finish up tests for Profile module ... once this patch lands, those tests can continue to be developed

CommentFileSizeAuthor
profilewarning.patch1.63 KBbleen
profilewarning.patch1.63 KBbleen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bleen’s picture

Status: Active » Needs review

not sure why the patch added twice ... they are both the same

bleen’s picture

bump .. this is holding up a few tests :)

montesq’s picture

Hi bleen18 ,

I don't know what you want to say in "navigate to /profile"? Is it /user instead?

bleen’s picture

montesq ... no I mean browse to www.mysite.com/profile

This will only work (apparently) on sites that are upgraded from D6... oy
#608894: Resolve the conflict between the fieldable users UI and the profile module
#958086: Profile module missing from module list

montesq’s picture

Yes indeed, it's only for D7 upgraded from D6. However, can tell me:
1° whether the user field is created in D6 or D7?
2° whether the user already exists in D6 or is created in D7?

I need these information about the steps to reproduce it and check your patch fix it.

bleen’s picture

when I originally filed this issue, the profile module was treated like all the other modules in drupal. At that time d6 was not a consideration... I was creating the field in d7

mr.baileys’s picture

Status: Needs review » Postponed (maintainer needs more info)

I've followed the steps outlined in the original post but did not come across the warning. Can you try again with HEAD and see if this error still occurs? See administer user profiles in Drupal 7 for information on how to enable profile.module on a clean D7 install.

bleen’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Thanks for pointing me to http://drupal.org/node/874026 ...

I also was no longer able to reproduce this error .... it must have been fixed somewhere else along the line.