Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Steps to reproduce:
- New d7 install (enable profile module)
- add new profile field ("Public field, content shown on profile page and on member list pages. ")
- give that field a value for a user
- navigate to /profile
- 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
Comment | File | Size | Author |
---|---|---|---|
profilewarning.patch | 1.63 KB | bleen | |
Comments
Comment #1
bleen CreditAttribution: bleen commentednot sure why the patch added twice ... they are both the same
Comment #2
bleen CreditAttribution: bleen commentedbump .. this is holding up a few tests :)
Comment #3
montesq CreditAttribution: montesq commentedHi bleen18 ,
I don't know what you want to say in "navigate to /profile"? Is it /user instead?
Comment #4
bleen CreditAttribution: bleen commentedmontesq ... 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
Comment #5
montesq CreditAttribution: montesq commentedYes 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.
Comment #6
bleen CreditAttribution: bleen commentedwhen 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
Comment #7
mr.baileysI'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.
Comment #8
bleen CreditAttribution: bleen commentedThanks 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.