I get the following notice when I change or try to customize the login one time destinations on the settings page and then save the settings.

Notice: Undefined offset: 1 in login_one_time_path_options() (line 375 of /.../.../example.com/sites/all/modules/login_one_time/login_one_time.module).

Any recommendations on how to correct this? I'm still new to coding etc.

Thanks!

Comments

javier.drupal.2012’s picture

Hi Seph, did you solve this issue? I have the same one
Thanks

cstillwell’s picture

I've seen this error, too.

Seph and javier.drupal.2012, on the login_one_time admin page do you have "Custom paths" defined? And if so, are you using key|value pairs, or do you just have a path on each line?

It looks like lines 374-375 in login_one_time.module assume you're using key|value pairs, and offset 1 corresponds to the value, which is undefined if you've just got a path (causing the error).

In my case, I just added a display value to my path (from "path" to "path|Path"), but the code fix (which I have not really tested) is probably a matter of changing line 375 from:

<?php
$options[$custom_option[0]] = $custom_option[1] ? $custom_option[1] : $custom_option[0];
?>

To:

<?php
$options[$custom_option[0]] = isset($custom_option[1]) ? $custom_option[1] : $custom_option[0];
?>
ashwinsh’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new719 bytes

Added patch file for this issue, please check it.

bapi_22’s picture

Assigned: Unassigned » bapi_22

  • ashwin.shaharkar authored ed93647 on 7.x-2.x
    Issue #1959546 by ashwin.shaharkar, bapi_22: Get PHP Notice when setting...
bapi_22’s picture

Status: Needs review » Fixed

Thanks @ashwin.shaharkar for the patch. Committed.

Status: Fixed » Closed (fixed)

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