profile categories translation causes error on user page
dsp1 - March 19, 2007 - 20:47
| Project: | Internationalization |
| Version: | 5.x-1.x-dev |
| Component: | Module i18nprofile |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
profile categories translation shows on the bottom of the user page and causes an error.
warning: Invalid argument supplied for foreach() in /home/xxx/modules/user/user.module on line 655.
why is the profile categories translation shown on the bottom of the user page?

#1
seems like the i18n_profile module is passing the translated category to the translated page even though the profile field is private.
the english page does not show the category and no error.
#2
looks like it passes the category also if it is public, but array has no fields entered.
ie. Name field is not filed in, but category on translated page shows and so an error.
#3
if I use english in the translation field, it still has the php error.
if I clear the category translation, then no more error.
This seems very similar to http://drupal.org/node/125248 problem that was just patched.
no one else translating profile categories?
#4
#5
upgraded to version 5.x 2.0 and still getting the error, but slightly different.
warning: Invalid argument supplied for foreach() in /home/xxx/sites/all/themes/mytheme/template.php on line 48.
/en/user/1/ is ok, the error only happens when switching to the another language /ja/user/1
I didn't mention in the first post, that this is for category Terms which only has one field profile_terms that is a checkbox, required. I set to private field and also tried hidden, but same result.
The category Terms does not show on the english page which is correct because the field that belongs to the category is hidden, but on the other languages the Terms shows on the user view page if translated.
#6
The problem occurs when you add translations to Categories and when the selected user's profile there isn't any saved information regarding these categories. It happens because function i18nprofile_profile_alter($account, &$fields) which replaces the categories in the profile with the translations simply does not check whether there are any fields of the categories. Solution is simple:
Find function i18nprofile_profile_alter($account, &$fields) and in the definition find the line:
if($translation && $category != $translation) {
and make it look like this:
if($translation && $category != $translation && isset($fields[$category]))
[10x to z3r0-T]
#7
I havent been able to reproduce it. Applied the fix by bitstream though, so it should be fixed (Check out 5.x-2.4 version) version)
#8
Automatically closed -- issue fixed for two weeks with no activity.