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
Comment #1
salvisMakes sense, but I see this more as a feature request — pushed to the -dev version.
Please let us know how it works.
Comment #3
robertstaddon commentedThe dev version works great. Thank you!
Comment #4
salvisGreat, thanks.
Comment #5
karlnack commentedI 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.
Comment #6
karlnack commentedHere's a version of the patch that applies cleanly against -dev, should you decide to use it.
Thanks.
Comment #7
karlnack commentedFix 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.