This error appears after edit and save any other user profile.

Notice: Undefined index: autologout_user_XYZ in autologout_user_profile_submit() (line 339 of /var/www/docroot/sites/all/modules/contrib/autologout/autologout.module).

I found a quick solution, however would be helpful if someone else test it.

Comments

alexito created an issue. See original summary.

afsch’s picture

yogeshmpawar’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB

Hi alexito,

Your patch is working for me but I have restructured your patch with some modifications to check that variable is already set or not.

Please check this patch will work or not.

yogeshmpawar’s picture

Version: 7.x-4.3 » 7.x-5.x-dev

Any Update on this issue ?

ajits’s picture

Version: 7.x-5.x-dev » 7.x-4.x-dev

The 7.x-5.x branch has been discontinued but cannot be deleted from drupal.org.

For Drupal 7, please use the 7.x-4.x branch.

ajits’s picture

Status: Needs review » Postponed (maintainer needs more info)

Thanks for using the issue queue to report the bug! I tried this with vanilla Drupal instance locally and did not encounter any issue being logged to watchdog or in php error logs.
Can you try with the 7.x-4.x-dev release of the module and see if you can still reproduce it? If yes, can you provide more elaborate steps to reproduce it?

tom.camp’s picture

Unless a user is editing their own account, this will always throw the Undefined index warning.

Line 339 $userid = $form_state['user']->uid; returns the user that is editing, not the user being edited.
Line 340 in $val = trim($form_state['values']['autologout_user_' . $userid]); is looking for the user being edited.

So, if I am user 10 and editing user 400, line 340 is looking for the value autologout_user_400 but based on the code will be looking for autologout_user_10.

In other words, $current_uid and $userid will always be the same and only the user being edit if the user is editing their own account.

This is on D7 using version 4.5.

I am going to check on a vanilla D7 site, but this is what I am experiencing after upgrading to 4.5.

tom.camp’s picture

StatusFileSize
new583 bytes
ajits’s picture

Status: Postponed (maintainer needs more info) » Needs review

Thanks for the patch! Let's see what the testbot says before giving this a go.

the_g_bomb’s picture

Status: Needs review » Closed (won't fix)
Issue tags: +DevDaysAthens2026

The patch is 8 years old; closing due to lack of response.
This is for an unsupported version.
Please reopen if this is still needed in a more recent branch.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.