I get this notice whenever I try to save settings in admin/config/people/pcp:

Notice: Undefined index: pcp_enable_user_picture in pcp_admin_settings_submit() (line 211 of /path/to/modules/pcp/pcp.admin.inc).

It appears the form field is conditionally created, but unconditionally read out. This patch adds the same condition around the setting as is used to create the form field.

Comments

BarisW’s picture

Status: Needs review » Patch (to be ported)
+++ b/pcp.admin.incundefined
@@ -208,7 +208,8 @@ function pcp_admin_settings_submit($form, &$form_state) {
+      if (variable_get('user_pictures', 0))
+        variable_set('pcp_enable_user_picture', $form_state['values']['pcp_enable_user_picture']);

Doesn't conform to the coding standards. We need {} for if statements. So it should be:

if (variable_get('user_pictures', 0)) {
  variable_set('pcp_enable_user_picture', $form_state['values']['pcp_enable_user_picture']);
}

Other than this: good catch. Will be committed in the next round of changes.

Peter Bex’s picture

Oh sorry about that. I should read the style guide more thoroughly I guess

BarisW’s picture

Status: Patch (to be ported) » Fixed

Added to .dev with proper git attribution. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.