Active
Project:
Feed Element Mapper
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Nov 2008 at 20:35 UTC
Updated:
27 Jun 2009 at 13:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
summit commentedHi,
The patch on http://drupal.org/node/265196#comment-1073099 worked for me on Drupal 5 as to that effect that I got the location_mapper showing on the parent-feed. The missing part was that I also needed to enable location info on the feed-item nodes on which the feed is mapped to.
I added the underneath lines to the patch so that country, province, city, street and postal_code info is included.
See attached picture for mapping of the country field to Tag[2].
I would expect this info to be inserted in the location database table and on the location_country field on the specific nodes. But that is not the case.
Can somebody tell me what I do wrong maybe?
Thanks a lot in advance for your response!
Greetings,
Martijn
Comment #2
alex_b commentedMartijn, Without looking at this closer: Does this issue also concern Drupal 6?
Comment #3
summit commentedThe answer is YES Alex.
Greetings,
Martijn
Comment #4
alex_b commentedNot a hard thing to come by ;-)
Comment #5
summit commentedHi Alex,
testing also on Drupal 6 :)
I saw this code was added in the parser_simplepie.module also for drupal 6.
How does this need to be altered to also have also country, province, city, street and postal_code?
Are there also other changes I have to look for to alter the code to have the country, province, city, street and postal_code in the location table from feedapi?
greetings,
Martijn
Comment #6
alex_b commentedWhere does this information sit on your feed? Does simplepie know about these properties? If not, there is no straightforward way to expose this information to the FeedAPI.
FeedAPI and Feed Element Mapper for Drupal 5 are rapidly receding into history, I'm really reluctant to add new features to them. So far the patches we're talking about are not very invasive - it should be easy for you to maintain a patched 5.x version for your project.
#3 - I assume that there is no bug that also affects Feed Element Mapper for 6 but this is only a feature request for 5.x - correct me if I'm wrong.
Comment #7
summit commentedHi Alex.
Your remark Where does this information sit on your feed? Does simplepie know about these properties? If not, there is no straightforward way to expose this information to the FeedAPI.
The information sits on a productfeed which I can load into feedapi. What I would like is similar to the lat/lon fields, only it effects the other feeds from location: country, province, city, street and postal_code, so I can map my feed fields to these on location_mapper (likewise taxonomy_mapper).
I am fine if you add those only to D6, I will then myself maintain a D5 version. Off course I understand D6 is the way forward! I set this then as feature request for D6.
Thanks a lot in advance going into this.
Greetings,
Martijn
Comment #8
summit commentedHi Alex,
Will not open http://drupal.org/node/265196. Thanks for getting lat/lon in.
Please also bring the other location fields in:
I do not know how to code the stuff in parser_simplepie.module to get this in. Present code:
Please help me so I can map my feed fields to country, province, city, street and postal_code on location_mapper (likewise taxonomy_mapper).
Thanks a lot in advance!
Greetings,
Martijn
Comment #9
summit commentedGuys, Alex is to bussy with great other work.
Anyone can help get this roaling?
Thanks a lot in advance!
Greetings,
Martijn
Comment #10
summit commentedHi,
I installed the patch http://drupal.org/comment/reply/316721/1115371#comment-1115371 to get the possibiltiy to get the other location information out of the feed. How now to I get other items mapped to the feed?
This is my add-on to simplepie_parser.module:
Greetings,
Martijn
Comment #11
summit commentedHi,
This is my feed item example now:
And this is my mapper screen now (see screenshot). country is from the location mapper country field as added on http://drupal.org/node/333519#comment-1107467
What I did:
Step 1) Install the location mapper from: http://drupal.org/node/265196#comment-1073099
Location mapper working ok
Step 2) Enhance location mapper with other location fields:
I see the other fields: country, province, city, street and postal_code in my mapper. So this step should be ok, right?
Step 3) Enhance simplepie_parser.module with the other location fields.
So feed data country should be mapped to location field country, right?
Whycan I only see one tag in the mapping screen?
Why can't I see the country field in the location table filled with any value?
Why can't I see the feed-items showing this location information?
I am really stuck here, please assist.
Thanks a lot in advance!
Greetings,
Martijn
Comment #12
alex_b commentedI assume #10 is a patch to parser_simplepie. I think that's not necessary.
You can write your own mapper after the model of one of the existing ones that goes through the tag array and maps tags to address data. I see you are identifying address data by its position in the tag array. This looks like a custom convention to me (?) - therefore I would keep this code in a custom module.
Understand that your custom mapper /can/ deal with node fields like taxonomy although there is already a taxonomy mapper.
For writing your own mapper, please refer to the resources on the project page of Feed Element Mapper: http://drupal.org/project/feedapi_mapper
This is a 5.x support issue.
Comment #13
summit commentedHi,
I am building a mapper with a friend (www.brambring.nl )which works on D6, but we are not able to get it working on D5. It seems the Drupal 5 mapper can't map per item (the D6 mapper can do this, right)
See here the code of my mapper which is working on D6. How to get it also working on D5?
I need a D5 version because it depends on the place module, which is not available on D6.
Any help getting this to work on D5 very much appreciated.
Greetings,
Martijn
Comment #14
burgs commentedMartijn,
try replacing
$node->locations[0][$sub_field] = $feed_element;with
$node->location[$sub_field] = $feed_element;towards the end of your script.
Comment #15
summit commentedHi Simon,
thanks for your reply!
Will: $node->locations[$i][$sub_field] = $val; work in D5 then, or need I alter something there also?
greetings,
Martijn
Comment #16
burgs commentedI've tested a demo version with just the one line replaced. I haven't looked into how it works too much, but if it's an array, do the first bit, otherwise, use that line of replaced code.
Try it out, but i don't think you need to change anything else.
Comment #17
burgs commentedYou're right, it fails big time in drupal 5
This is the (heavy) mod that i've made to see if this thing will update properly. It works for single addresses, which seems appropriate for csv imports (which is what i'm doing).
Let me know if this suits your current set up and maybe we can think about a patch to submit.
Comment #18
gionnibgud commentedHi this is the full list of fields for mapping:
cheers
Comment #19
alex_b commentedIs this a duplicate: #363331: D6 - Location all fields mappings ?
Comment #20
summit commentedHi Alex,
No this thread is about D5 solution, the other one is D6.
greetings,
Martijn
Comment #21
j0k3z commentedHow do I use the code in this thread? Is there a patch or is this a new file I need to create?
Comment #22
summit commentedHi Farang,
This is custom code for specific feedapi-parsing I use with another parser in D6, it is not working in D5 unfortunately
Off course I can try to help you to get what you want.
What is your question, what you want to do with this code?
You can build a patch of course from this thread if you like.
Greetings,
Martijn
www.reizen-naar.nl
Comment #23
socialnicheguru commentedWhile I get lat and lon to connect to, I don't get the venue, street, province, etc location fields.
Chris
EDIT:
I get all fields if I do not try to map country which is a drop down select.