When editing a profile using the administrative overlay, I get the following warnings:

Notice: Undefined variable: accepted in legal_form_user_profile_form_alter() (line 296 of /var/www/html/sites/all/modules/legal/legal.module).
Notice: Undefined variable: accepted in legal_form_user_profile_form_alter() (line 310 of /var/www/html/sites/all/modules/legal/legal.module).
Notice: Undefined variable: accepted in legal_form_user_profile_form_alter() (line 336 of /var/www/html/sites/all/modules/legal/legal.module).

When editing a profile without the overlay, no warnings appear.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nexotap’s picture

FileSize
552 bytes

I just had the same problem. i solved it, while adding an extra line where $accepted gets defined.

See the patch file for my solution. I dont know if that's the right attempt, at least it solves the problem for me.

You may also blame me for the patch file, since this is my very first (blush) patch I'm commiting.

Cheers

~Nexo

BTW. If I do, like here, have a patch. Am I encouraged to change the Status for the Issue?

rooby’s picture

Title: Warnings when editing user profile with administrative overlay » Warnings when editing user account
Status: Active » Needs review

I get the first error when UI

Notice: Undefined variable: accepted in legal_form_user_profile_form_alter() (line 296 of /var/www/html/sites/all/modules/legal/legal.module).

I get this and I am not using the admin overlay.

@Nexotap:
Yep, when you add a patch set to needs review.
See http://drupal.org/node/156119 for more information.

rooby’s picture

Title: Warnings when editing user account » Warnings when editing user profile with administrative overlay
FileSize
491 bytes

Here is a slight variation on the patch in #1.

rooby’s picture

Version: 7.x-1.2 » 7.x-1.x-dev

Patch is against dev but applies to 7.x-1.2

rooby’s picture

Title: Warnings when editing user profile with administrative overlay » Notice: Undefined variable: accepted in legal_form_user_profile_form_alter()

Oops, I accidentally changed the title back.

cpliakas’s picture

Status: Needs review » Reviewed & tested by the community

Getting the same error, patch in #3 works as advertised.

Anonymous’s picture

While the patch works it needs some work with regard to indentation alignment so that it matches the previous code. There needs to be indentation alignment work WRT drupal coding standards throughout the module but that is a different issue.

cpliakas’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
496 bytes

The attached patch uses the same functionality but performs indentation according to Drupal Coding standards. As mentioned in #7, a separate issue should probably be opened to address the other issues throughout the module.

Thanks,
Chris

cpliakas’s picture

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community
marcoka’s picture

tested, seems to be obvious to initialize the variable $accepted in this case because in code it is only "filled" in the "else" and that doesnt always we called.

marcoka’s picture

push. any opinions from the maintainers?

eodonnell’s picture

Can we get this committed?

Robert Castelo’s picture

I can't reproduce this error.

What page are you on (path)?

Are you logged in as admin or the user who's account is being edited?

"When editing a profile" - do you mean an account page?

Robert Castelo’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)
Robert Castelo’s picture

Status: Postponed (maintainer needs more info) » Fixed

Added cpliakas patch in #8 to dev

Couldn't reproduce the issue, but makes sense to initialise the $accepted variable. If this hasn't fixed the issue please re-open with more info on how to reproduce the bug.

Status: Fixed » Closed (fixed)

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

chrisjlee’s picture

I have the same problem and unintentionally created a duplicate issue #1935350: Notice: Undefined variable: accepted in legal_form_user_profile_form_alter() (line 296 of /home/ubuntu/site/prod/sites/all/modul

From #1935350: Notice: Undefined variable: accepted in legal_form_user_profile_form_alter() (line 296 of /home/ubuntu/site/prod/sites/all/modul:

Error is produced when you do the following:

  1. install module
  2. clear the cache
  3. as an administrator visit a user that was created before they've actually accepted the ToS
  4. Upon reaching the user page the error notice occurs and is seen at /user/