Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Am I correct that the location mapper is not yet on the mapper-2-branch?
Thanks for your answer in advance.
greetings,
Martijn
Comment | File | Size | Author |
---|---|---|---|
#25 | feedapi_mapper_location.txt | 2.92 KB | nemchenk |
#23 | feedapi_mapper_location.txt | 2.91 KB | flamingvan |
#8 | feedapi_mapper/mappers/feedapi_mapper_location.inc | 3.6 KB | nicholas.alipaz |
#6 | mappers.jpg | 33.05 KB | stevestaso |
#6 | mapper-errror.jpg | 28.48 KB | stevestaso |
Comments
Comment #1
Aron Novakhttp://cvs.drupal.org/viewvc.py/drupal/contributions/modules/feedapi_map...
There is a location mapper for 2.x
Comment #2
Summit CreditAttribution: Summit commentedDoes it work on cck_location or location native?
I am not getting it to work?
Did: Add cck_location field to feeditem nodetype
Did: set feeditem nodetype as parser "export" nodetype
Did: set in feeditem nodetype location to 1
But nu location_mapper in MAP area of the feed..
Thanks a lot for your reply in advance!
greetings,
Martijn
Comment #3
Aron NovakThank you for reporting more information.
This is definitely a bug, unfortunately. Here is a patch.
Can you test it?
If it works for you, feel free to set the patch to RTBC.
Unfortunately the location is the only mapper without any tests, i'd bet this is the root of the bug here.
Comment #4
Summit CreditAttribution: Summit commentedHi Aron,
Will try to test this evening, thanks for your quick response!
greetings, Martijn
Comment #5
Summit CreditAttribution: Summit commentedHi Aron, it is working now, thanks!
Why not mapping for all fields available?
Altering:
To:
Is sufficient for this, right?
Greetings,
Martijn
Comment #6
stevestaso CreditAttribution: stevestaso commentedAfter updating to 6.x-2.x-dev, the location mapper doesn't show up unless I add a CCK location field.
At the bottom of the Map tab:
Instead of the location mapper, I now see a mapper for feedapi_node module.?.
See attached.
I verified the same items in #2.
I added the patch in #3. Still no joy.
If I add a CCK location field to the feeditem nodetype, upon saving - I get an error for each item in the list (as attached)
I use the csv parser and the FeedAPI Node processor.
Other elements map OK.
But I can't get the location elements to map to the node's location fields - CCK or native.
(I added subfields like #5)
I've also tried the 6.x-1.0 version.
That shows the location mapper listed at the bottom; I mapped some location elements, but the mapping never occurs.
Any guidance on how to troubleshoot this?
Thanks in advance.
steve...
Comment #7
Summit CreditAttribution: Summit commentedHi,
Any progress in this field please? Is the location_mapper working now correctly?
And will it also work on location AND cck_location, or only the cck_location in the future?
Thanks for your reply in advance.
Greetings, Martijn
Comment #8
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedThe attached file was written with the 2.x branch.
I am attaching the work I just recently did on this for a site I am working on. It works to get mapping a source to a target location enabled node.
Some things to note that will likely still need work:
I did not code it to work for multiple locations, since I didn't need it for this site, I am sure someone else can make it work with multiple.
hook_feedapi_mapper()
function, so some of my code could be a bit strangeThe overbearing issue that seems to have caused this mapper to break is that the location module seems to be requiring that we send it an array with all values of the array filled in. I am not sure if this were the case in prior version of the location module. I found that if I tried to just send latitude and longitude or anything less than the full array the values were not inserted into the mapped fields. This occurs even if you set some of the fields to "not collected" in the content type. However, you can send empty strings instead.
* normally I would send this as a patch, but it is a complete rewrite so I am just attaching the file here.
Comment #9
Summit CreditAttribution: Summit commentedHI, this mapper (http://drupal.org/comment/reply/559744/2045510#comment-2045510) let me see the location mapper again.
I got this error now.
EDIT: I found the problem. In the attachment there is the line
This needs to be:
Still no success though with the mapping, yes the fields show, but how to map correctly?
greetings,
Martijn
Any suggestions please?
greetings,
Martijn
Comment #10
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedThis version of the file will only map to the default node elements in the node. They cannot be mapped to cck fields. Are you using the node elements provided by the location module? Can you describe in more detail what you are doing/what is happening?
Maybe even a screenshot of your mappers and the content type you are mapping to would help. Also what version of the location module, feedapi_mapper, and feedapi?
Comment #11
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedWhat you changed in your previous post should not be necessary and is very unlikely to fix that error. Seems to be a coincidence.
Comment #12
Summit CreditAttribution: Summit commentedHi,
Your question: They cannot be mapped to cck fields. Are you using the node elements provided by the location module? Can you describe in more detail what you are doing/what is happening?
I use location (not cck_location) as you described.
I would like to map a rssfeed with category fields filled with geographical information mapped to the location info in the node:
These values needs to be mapped to:
-"NL" -> Location $country (country_code)
-"Nederland" -> Location $country_name (country_name)
It seems that location is not working without using proper isocode and countryname, right?
Thanks a lot in advance for your assistance.
Greetings,
Martijn
Comment #13
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedYes, in my testing you must provide the proper countryname to the appropriate field, or leave it blank will work I believe. But if you send it incorrect info then it will most certainly not allow any fields to fill in.
As stated in comments in my code,
So leaving a field "empty" is ok, but if you fill it in with incorrect info then it will cause all other fields not to get filled in since it requires a full array to be submitted. One wrong field breaks the mapping on all others in my experience.
Further testing by others would certainly be of use in getting a working version of this mapper.
Comment #14
Summit CreditAttribution: Summit commentedHi,
Is by your testing it enough to send the country_code ($country)? Or needs location country_code AND countryname? I am not able to get a location record filled through the mapper.
And do you know how to map fields which are in a array in the rss, like category[0] and category[1]?
greetings, Martijn
Comment #15
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedI have not tested with arrays. Merely with a single value to a single field. Seems there is a lot to be tested here. On your install I would attempt testing with basic values first and see if it works, then proceed to make it more complicated. If you can't get a basic implementation to work with this, then the arrays and such are most certainly not going to work.
Comment #16
Summit CreditAttribution: Summit commentedHi,
I think this post is relevant about location field mapping I think: http://groups.drupal.org/node/27864
Especially:
# When solving 1 and 2 the locatiomodule will still attempt to find ‘better’ coordinates and throw away the provided onces
# The location module will not produce georss information for fields stores in ckk ( and the mapper stores in ckk only)
Greetings,
Martijn
Comment #17
Yorgg CreditAttribution: Yorgg commentedI have updated to 6.x-2.0-alpha3 and location cck or geo field mapping are still not available although.
By nicholas.alipaz @ #8 rewrite fields are now available and seem to be working via cck, or did I made the location node enabled in the background?
I can see longitude and latitude on the node teasers but not on the cck itself.
Comment #18
Summit CreditAttribution: Summit commentedHi my update:
I now have got a nicely rss feed to be able to map within feedapi, feedapi_mapper, location scope.
It has all fields necesseray for mapping I think: georss: lat, lon, isocode in lower case for country isocode. But nodes will through mapper not be filled with geo (location) info...
greetings, Martijn
Comment #19
Summit CreditAttribution: Summit commentedHi, #10 (remark from author #8) says clearly it is NOT working through CCK..
Comment #20
Summit CreditAttribution: Summit commentedHi Aron,
Patch from #3 was NOT committed to alpha 3. Will you get it in within alpha 4 please?
Next to this my findings are that somehow location_mapper does not map location information with a negative latitude.
Record with the following is mapping correct:
Record with the following is NOT mapping correct:
Thanks for committing the #3 thingie already!
Greetings,
Martijn
Comment #21
Summit CreditAttribution: Summit commentedHi,
How can I debug what is coming out of the location mapper. I am in the blind now :(
I would love to see what array goes out to be mapped to nodes:)
EDIT: drupal_set_message is my friend!
I had it working, but where can I find feedapi_test_location_var()
Now it says: Call to undefined function feedapi_test_location_var()
EDIT: still can't find this function, could you atrach it to your reply please?
Thanks a lot for your reply!
Greetings,
Martijn
Comment #22
Summit CreditAttribution: Summit commentedHi,
This is a version of feedapi_mapper_location which I am working with right now:
The else is not working correct yet:
$node->{$field_name}[0][$sub_field] = $feed_element[0];
And the feeditems which have correct countrycode (isocode) and lat/lon will get somehow the standard isocode and not the one which is also already in the feed..
But may be this version is also a great improvement for the discussion to get a good working feedapi_mapper_location which works for cck_location (this version does) and also location (this version does not).
Great improvement of this version is the stuff to not use geocode of location if georss already in feed. Great problem is isocode still..
greetings,
Martijn
Comment #23
flamingvan CreditAttribution: flamingvan commentedI've made some modifications to nicholas.alipaz's mapper for native locations. His originally didn't work at all for my installation, so I fixed it and then I made it capable of mapping to multiple locations. I hope this will be helpful to someone.
Location version 6.x-3.1-rc1
Mapper version 6.x-1.0
Comment #24
Summit CreditAttribution: Summit commentedHi, Would be great also have location_mapper on feeds, because feedapi will go away..
Greetings, Martijn
Comment #25
nemchenk CreditAttribution: nemchenk commentedI had to edit #23 a little bit to get it to work for me, basically changing line 79 to be "for($x = 1; $x < $num_locations + 1; $x++){". I also replaced all the tabs with spaces, and sorted out some of the indentation and blank lines.
I enclose the whole file as a patch would be too confusing because of all the indentation changes. This works for me with Location 6.x-3.1-rc1, FeedAPI 6.x-1.8, and Feed Element Mapper 6.x-1.3.