Active
Project:
Location Feeds
Version:
7.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Dec 2012 at 01:13 UTC
Updated:
19 May 2013 at 03:24 UTC
Jump to comment: Most recent file
This appears to be related to the issue described in #1344958: Feeds import failing on "Feeds import failing on".
I am importing from a file using the xpath parser. When tags for latitude and longitude are missing or contain 0, 0 I get the same error reported in that issue
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'field_location_lid' at row 1
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | Mapping with 2 temporary targets and the final field mapped to coordinates | 71.69 KB | doubouil |
| #1 | Tamper setting for the final field | 74.86 KB | doubouil |
| #1 | Copy each value in our final field and then implode it | 63.88 KB | doubouil |
Comments
Comment #1
doubouilI somehow fixed it using Feeds JSONPath Parser with Feeds tamper (warning, need a quick patch for last version of Feeds, see this issue)
Mapping should allow you to use xpath parser instead of JSONPath since the trick is to rewrite the values and populate the coords target instead of each latitude & longitude target.
You have to had two temporary targets mapped to your source latitude & longitude. Then, map an xpath or JSONPath expression to the coordinates target.
Using Tamper, add 3 operations :
- Copy source value from the temp target latitude to the mapped expression field
- Copy source value from the temp target longitude to the mapped expression field
- Add an implode with a comma on the resulting feed
I only used the location name and coordinates mapping (I don't need province or city fields), and my empty values are created perfectly.
Comment #2
mikel1 commentedThanks doubouil for the suggestion. Since I create the feed, rather than use feeds_tamper, I just packed the lat. ad long. into a field with a , in between. No luck for me. FWIW here is a dump of the field just before the return in location_feeds_set_target().