Since the multiple-location updates, if trying to add location information through another module (e.g. GeoRSS module, in association with Aggregator2 module), foreach errors are returned in the location_nodeapi() function because locations are added during the insert/update phase, not the validate phase, where location module is expecting them. Problems also arise when using aggregator2 module without the GeoRSS module, when location fields are enabled on the feed entry node type.
The attached patch (against 4.7, but same applies for 5.0) escapes out of the location_nodeapi() function if the node types are location-enabled but have no $node->locations at that point in time. I don't think it breaks anything else - locations can still be added through the node form etc.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | location_foreach_problem2.patch | 2.11 KB | geodaniel |
| location_foreach_problem.alternate.patch | 1.11 KB | geodaniel |
Comments
Comment #1
geodaniel commentedpknag confirms that this fixes a similar issue in http://drupal.org/node/113429 as well
Comment #2
geodaniel commentedAnkur, can you see any potential issues with this one? Safe to apply?
Comment #3
geodaniel commentedI've not tested this fully with other modules, but after applying the patch at http://drupal.org/node/109611 I didn't need to use this one. I'll update this ticket once I've tested some more.
Comment #4
geodaniel commentedI've done a bit more testing and this is still relevant. Using the latest versions of Feedparser and GeoRSS module, the foreach errors are thrown for nodes that don't have location information being assigned (this patch fixes that). Replacing Feedparser with Aggregator2 and the same problem happens but it also gives a foreach error on line 88 of location.inc. Not sure why theme_locations is being called when agg2 is adding nodes, but I'll take a look and update the patch once I've had a chance to look into that.
Comment #5
geodaniel commentedThis updated patch stops the foreach errors with both modules I've tried it with - feedparser and aggregator2.
Comment #6
geodaniel commentedCommitted on 4.7. I've not tried this in 5.x yet, but I suspect it's still relevant there as well.
Comment #7
bdragon commentedI'm pretty sure this is fixed now.
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.