Notice: Undefined index: und in commons_radioactivity_groups_incident_groups() (line 65 of /home/abcdef/public_html/mnop.in/profiles/commons/modules/commons/commons_radioactivity/commons_radioactivity_groups/commons_radioactivity_groups.module

Warning: Invalid argument supplied for foreach() in commons_radioactivity_groups_incident_groups() (line 65 of /home/abcdef/public_html/mnop.in/profiles/commons/modules/commons/commons_radioactivity/commons_radioactivity_groups/commons_radioactivity_groups.module).

Comments

lsolesen’s picture

Version: 7.x-3.15 » 7.x-3.16

I can confirm this happens on a clean install.

devin carlson’s picture

Version: 7.x-3.16 » 7.x-3.x-dev
Status: Active » Needs review
StatusFileSize
new2.7 KB

This only occurs when OG Access is enabled.

A patch to add additional checks to ensure that the node has an og_group_ref field and to improve the retrieval of field items.

devin carlson’s picture

Status: Needs review » Fixed

Tested #1 with both a fresh and an existing Commons install and verified that it fixed the notice when OG Access was enabled and did not introduce any problems when it is not in use.

Committed to Commons 7.x-3.x.

  • Devin Carlson committed a5cc4c8 on 7.x-3.x
    Issue #2306193 by Devin Carlson: Fixed PHP notice in Commons...
todoele’s picture

I get this error on deleting a post assigned to a group:
"Notice: Undefined index: und in commons_radioactivity_groups_node_delete() (line 46 of /mnt/www/html/youspanishdev/docroot/profiles/commons/modules/commons/commons_radioactivity/commons_radioactivity_groups/commons_radioactivity_groups.module)."

On line 46 on the file I see this:
// If this node is a member of groups, generate incidents for each group.
commons_radioactivity_groups_incident_groups($node, -1 * $node->field_radioactivity[LANGUAGE_NONE][0]['radioactivity_energy']);
}

I have noticed that when the post is not assigned to a group the message does not appear.
Also, the message appears when the post has 0 radioactivity. When I assign some radioactivity to the post, even if it is in a group, the notice does not show up when I delete them.

Status: Fixed » Closed (fixed)

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

heddn’s picture