--- scheduler.module 31 Jan 2011 19:13:43 -0000 1.51.2.18 +++ scheduler.module 31 Jan 2011 20:47:22 -0000 @@ -961,11 +961,11 @@ * Implementation of hook_feeds_node_processor_targets_alter(). * advertises publish_on and unpublish_on as mappable values to the feeds module */ -function scheduler_feeds_node_processor_targets_alter(&$targets, $content_type) { - $target = array(); +function scheduler_feeds_processor_targets_alter(&$targets, $processor, $content_type) { + + $publishing_enabled = variable_get('scheduler_publish_enable_'. $content_type, 0); + $unpublishing_enabled = variable_get('scheduler_unpublish_enable_'. $content_type, 0); - $publishing_enabled = variable_get('scheduler_publish_enable_'. $content_type, 0) == 1; - $unpublishing_enabled = variable_get('scheduler_unpublish_enable_'. $content_type, 0) == 1; if ($publishing_enabled) { $targets['publish_on'] = array( 'name' => t('Scheduler: publish on'), @@ -980,8 +980,6 @@ 'callback' => 'scheduler_set_target' ); } - - return $targets; } /** @@ -990,11 +988,14 @@ * This callback converts input from parser and converts it * to timestamp form. After that it sets value of correct field of node. */ -function scheduler_set_target($node, $target, $value) { +function scheduler_set_target($source, $node, $target, $value) { if (!is_array($value)) { - - $timestamp = strtotime($value); - + if (!is_numeric($value)) { + $timestamp = strtotime($value); + } + else { + $timestamp = $value; + } // if strtotime returned correct timestamp, we proceed with // processing. Otherwise do nothing.. if (($timestamp !== FALSE) && ($timestamp != -1)) {