Mapper for $node->status
ytokan - February 12, 2009 - 14:41
| Project: | Feed Element Mapper |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Hi
in my rss Feed i have add pubish and unpublish date fields, and i want to map them in Scheduler fields.
But the fields are not propose in the map options
Do you have a solution or a idee ?
++
Yto

#1
I understand that you would like to map the published state of the feed item to the published state of the node you create, correct?
This is not supported at the moment, but would be very easy to do.
See how feedapi_mapper_node.inc maps to $node->created? The same way you could map to $node->status (which holds the published information of a node).
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/feedapi_map...
This functionality should ideally sit in feedapi_mapper_node.inc; instead of
if (in_array($field_name, array('title', 'body', 'created')))it would be
if (in_array($field_name, array('title', 'body', 'created', 'status'))) {The description (if ($op == 'describe') ) would have to be updated, too of course.
#2
#3
Hey! Here is the patch for this functionality which we needed for one of our sites.
David
#4
Looking good.
Nitpicks:
...status or a body of a node
should be
published state or a body of a node
there should be a linebreak before else and elseif
#5
As you wish :-)
David
#6
Uh, found more small stuff :-)
1)
<?php$node->{$field_name} = ($feed_element) ? 1 : 0;
?>
Should be
<?php$node->{$field_name} = empty($feed_element) ? 0 : 1;
?>
2)
Published State -> Published state
#7
Here you go.
David
#8
This is looking good.
RTBC
Nice work.
#9
#10
Automatically closed -- issue fixed for 2 weeks with no activity.