I get the Following PHP notice

Notice: Undefined offset: 0 in context_condition_useragent->condition_form() (line 22 of /var/www/fyn_local/sites/all/modules/contrib_modules/context_useragent/context_condition_useragent.inc).

Thanks,
Dinesh

Comments

bryan cordrey’s picture

I am noticing the same issue. Has there been any progress on this issue?

bpirkle’s picture

I fixed it by changing the offending line to:

    $form['#default_value'] = array_key_exists(0, $values) ? $values[0] : 0;
john bickar’s picture

Issue summary: View changes
StatusFileSize
new694 bytes

It doesn't even look like you need to explicitly define the #default_value for that form field. Deleting the code that sets that still allows the form to pick up the regex defined in an existing context_useragent condition, unless I'm missing something.

See attached patch.

john bickar’s picture

Status: Active » Needs review
sherakama’s picture

Status: Needs review » Reviewed & tested by the community

Patch is good. No need to define the default value.
Please roll it into project.

sherakama’s picture

Ping.

Checking in on getting this into a new release.

nicholas.alipaz’s picture

  • John Bickar authored 3cd2c8c on 7.x-1.x
    Issue #1326998 by John Bickar, sherakama, bpirkle: I get a notice on...
nicholas.alipaz’s picture

Status: Reviewed & tested by the community » Fixed

This is now committed. A new dev version with the change should show up soon.

Status: Fixed » Closed (fixed)

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