Bio module frequent logging of PHP Notice: Undefined index
tborrome - February 3, 2009 - 04:06
| Project: | Bio |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Jump to:
Description
I keep getting the following error in the Apache log files:
PHP Notice: Undefined index: q in /persistent/html/pilot.01/sites/all/modules/bio/bio.module on line 28
might not be a big issue functionally, but this may cause performance problems. This error gets logged every user access.

#1
I am getting this as well. Here's what I did to fix it (this is how it is handled in the Secure Pages module). (The first line is the only line I added, then I changed the conditional to follow suit:
(within function bio_init())
<?php$path = isset($_GET['q']) ? $_GET['q'] : '';
if ($path == 'node/add/'. bio_get_type()) {
if (($nid = bio_for_user()) && !user_access('administer nodes')) {
drupal_goto('node/'. $nid .'/edit');
}
}
?>
#2
Can you explain this a bit more? This is what my bio_init function looks like:
function bio_init() {
// TODO: This interferes with aggressive caching. Can we do this in
// hook_menu() instead? Looks like we'd need to make bio follow after node.
// Could cause problems w/ registration and/or CRUD functions.
// Don't allow non-admin users to create more than one bio.
if ($_GET['q'] == 'node/add/'. bio_get_type()) {
if (($nid = bio_for_user()) && !user_access('administer nodes')) {
drupal_goto('node/'. $nid .'/edit');
}
}
}
I'm using the 5.0.x-dev version. What do I change about this to get these errors to stop showing up?
#3
Bump.
#4
Please see #214141 for updates on this.
Thanks :)