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

Comments

alex_b’s picture

Title: FeedAPI Mapper and Module Scheduler » Mapping target $node->status
Category: support » feature

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.

alex_b’s picture

Title: Mapping target $node->status » Mapper for $node->status
David Goode’s picture

Status: Active » Needs review
StatusFileSize
new2.03 KB

Hey! Here is the patch for this functionality which we needed for one of our sites.

David

alex_b’s picture

Version: 6.x-1.0-beta4 » 6.x-1.x-dev
Status: Needs review » Needs work

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

David Goode’s picture

Status: Needs work » Needs review
StatusFileSize
new2.05 KB

As you wish :-)

David

alex_b’s picture

Uh, found more small stuff :-)

1)

$node->{$field_name} = ($feed_element) ? 1 : 0;

Should be

$node->{$field_name} = empty($feed_element) ? 0 : 1;

2)

Published State -> Published state

David Goode’s picture

StatusFileSize
new2.05 KB

Here you go.

David

alex_b’s picture

Status: Needs review » Reviewed & tested by the community

This is looking good.

RTBC

Nice work.

aron novak’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.