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.
I'm receiving numerous repetitive instances of this error when editing my Profile2 fields:
Edit a field, save settings for that field, returns to Profile2 Manage Fields with this error:
Notice: Undefined offset: 2 in pcp_get_tagged_profile_fields() (line 292 of /.../sites/all/modules/pcp/pcp.module).
Comments
Comment #1
scottsawyersame. I had 1.4 installed, disabled, uninstalled, installed dev-1.3, cleared cache, go to admin/structure/profiles, edit existing profile, I have multiple instances of the error.
Comment #2
BarisW CreditAttribution: BarisW commentedCan you try the dev version and let me know if you still have these issues?
If not, I'll release a new version of the module ASAP.
Comment #3
AlfTheCat CreditAttribution: AlfTheCat commentedHaving this issue too. Don't have profile2 installed.
The error is printed in the watchdog several times after login. I think it's also causing a blank screen on login at /user/login (not a WSOD, on refresh the profile page does show.)
Using the latest dev of this module.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedWith 7.x.1.4 everything works fine. When i try to use dev, i get many instances of this error + pcp stops showing percentage correctly.
Comment #5
BarisW CreditAttribution: BarisW commentedI can't reproduce this. I'd love to fix it, but whatever I try, I never get these notices.
Could you tell me how to reproduce this using a step-by-step instruction?
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedI just copy the new files over the old ones and a bunch of errors occurs on the next site load.
Is there any option for debugging? Can't find anything in any log.
Comment #7
AlfTheCat CreditAttribution: AlfTheCat commented@BarisW
I'm getting this on several sites. I'm not sure what causes it but one thing all sites have in common is that they use the user_view panels template. Again, in my case, after logging in at /user the page blanks out when redirected to the user's profile page.
Have you tried to reproduce it by activating the user profile panels template and placing the PCP block in there?
Hope this helps.
Comment #8
BarisW CreditAttribution: BarisW commentedI haven't test it with Panels, will do ASAP. Let's hope I can reproduce it, so we can finally close this issue ;)
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedi don't use panels. here's a list of my enabled modules:
Comment #10
kingfisher64 CreditAttribution: kingfisher64 commentedAhh, getting 21 of these messages (and I'm not bragging) using the latest dev.
Notice: Undefined offset: 2 in pcp_get_tagged_profile_fields() (line 289 of sites/all/modules/pcp/pcp.module).
@BarisW - Not sure what information I can give in addition to #9?
If it helps fix this I can give you a login to a copy of a site i'm working on with this displaying? It's a copy so you can fiddle around with the mod without consequence.
Need to use the dev as I believe 1.4 doesn't include rules integration? Wanting to do when a specific percentage is reached show a specific button in the user menu.
Comment #11
prezaeis CreditAttribution: prezaeis commentedim getting same problem.
i had the module installed and it worked fine, i then upgraded it to the latest DEV version and now seeing this error which repeats like 25 times. I have profile2 which im using it for, but the block doesnt even show anymore
any fix for this?
Comment #12
prezaeis CreditAttribution: prezaeis commentedFIXED IT
For anyone that may come across this, try this solution:
I upgraded (version 7) from the stable version to the Dev version today and got this error repeating several times on my site (Using it on profile2)
. Run update.php
. Clear Cache
. Edit the fields that you want to have set for the PCP module (You may have done this before but what i found is that after the upgrade the tick box on those fields was unselected, i then selected all the fields again and the error went away)
What i think happened is that after upgrade the fields were still saved in the database but for some reason in the edit page they were no longer selected, and this must have been causing a conflict or something.
But this error most likely will be solved by rechecking the fields for everyone.
Comment #13
bmango CreditAttribution: bmango commentedI was having the same error message more or less. My error message was "Undefined offset: 0 in pcp_get_user_profile_values() (line 392 of /sites/all/modules/pcp/pcp.module). I was also using the Profile2 module.
I tried the solution in #12, but that didn't work. I checked line 392 where the error was occuring in the pcp.module, and it looked like there was a value missing from the $field array (
$field['und'][0]['format']
), so I simply added in a dummy value. I replaced the line:$user_fields[$field_name] = $field['und'][0];
with
This got rid of all the error messages.
Comment #14
BarisW CreditAttribution: BarisW at LimoenGroen commentedThis has been fixed at #2206201: booleans with checkbox never are incomplete.
Comment #15
bmango CreditAttribution: bmango commentedI tried updating to the latest dev. Unfortunately, the errors are still there. The actual errors I am getting are:
The error seems to be with a reference to a non-existent array key
$field['und'][0]['format']
when it is looping through the values.