I am using a module (Drupal Membership Suite from MoneyScripts.net) that utilizes Drupal hooks to create subpages under the users Edit page. However, viewing these subpages with Fixcore enabled causes the following error in Drupal:

Notice: Undefined index: account in fixcore_form_user_profile_form_alter() (line 127 of /home/www/drupal/sites/all/modules/fixcore/fixcore.module).
Notice: Undefined index: pass in fixcore_form_user_profile_form_alter() (line 127 of /home/www/drupal/sites/all/modules/fixcore/fixcore.module).
Notice: Undefined index: #description in fixcore_form_user_profile_form_alter() (line 127 of /home/www/drupal/sites/all/modules/fixcore/fixcore.module).

This is triggered because $form['account'] does not exist on these subpages. When we call the fixcore_form_user_profile_form_alter function, we should not assume that $form['account'] actually exists.

This bug can easily be fixed by modifying line 126 of fixcore.module to insert a simple test:
if ($level = variable_get('fixcore_password_reminder', 0) && isset($form['account'])) {

Can we add this test to the next version of Fix Core?

Comments

salvis’s picture

Category: bug » feature
Status: Active » Fixed

Makes sense, but I see this more as a feature request — pushed to the -dev version.

Please let us know how it works.

Status: Fixed » Closed (fixed)

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

robertstaddon’s picture

The dev version works great. Thank you!

salvis’s picture

Great, thanks.

karlnack’s picture

Issue summary: View changes
StatusFileSize
new827 bytes

I ran into this too, and rolled a patch before discovering this issue. Presumably it does the same thing, but instead it checks the $form's "#user_category" to ensure that the account page is being edited and not some other subpage added by another module.

Regardless, it would be nice if there was a formal release with this issue fixed.

Thanks.

karlnack’s picture

StatusFileSize
new854 bytes

Here's a version of the patch that applies cleanly against -dev, should you decide to use it.

Thanks.

karlnack’s picture

StatusFileSize
new819 bytes

Fix for patch #5, which has a copy-and-paste error (grrrr). So patch #6 applies cleanly against 7.x-1.x-dev and this one applies cleanly against 7.x-1.1.

Anyway, sorry for the noise.