Closed (fixed)
Project:
Location
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
30 Mar 2005 at 00:05 UTC
Updated:
13 Apr 2005 at 03:16 UTC
Jump to comment: Most recent file
For node types that don't enable any location fields, the following code (near line 222) is problematic:
case 'insert':
case 'update':
$posted_location = $_POST['edit']['location'];
foreach ($posted_location as $posted_field => $posted_value) ...
If $_POST['edit']['location'] is unset (as will happen if no location forms are enabled), then we get an invalid argument error on the foreach statement. I've corrected this by inserting an additional condition before the foreach:
if (count($posted_location)) {
foreach ($posted_location as $posted_field => $posted_value) ...
This will keep the foreach, or any of the other nodeapi code, from being run if $_POST['edit']['location'] has 0 elements to it.
If you implement this fix, be sure to close the additional bracket you open!
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | location.module_0.diff | 6.7 KB | ankur |
Comments
Comment #1
ankur commentedThanks josh. Here's the patch I commited.
Comment #2
(not verified) commented