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

alex_b - February 13, 2009 - 16:12
Title:FeedAPI Mapper and Module Scheduler» Mapping target $node->status
Category:support request» feature request

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

alex_b - May 19, 2009 - 13:22
Title:Mapping target $node->status» Mapper for $node->status

#3

David Goode - June 2, 2009 - 21:15
Status:active» needs review

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

David

AttachmentSize
feedapi_mapper_node.patch 2.03 KB

#4

alex_b - June 2, 2009 - 22:50
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

#5

David Goode - June 3, 2009 - 13:25
Status:needs work» needs review

As you wish :-)

David

AttachmentSize
feedapi_mapper_node.patch 2.05 KB

#6

alex_b - June 3, 2009 - 14:03

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

David Goode - June 3, 2009 - 18:51

Here you go.

David

AttachmentSize
feedapi_mapper_node.patch 2.05 KB

#8

alex_b - June 3, 2009 - 21:23
Status:needs review» reviewed & tested by the community

This is looking good.

RTBC

Nice work.

#9

Aron Novak - June 20, 2009 - 09:45
Status:reviewed & tested by the community» fixed

#10

System Message - July 4, 2009 - 09:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.