Mercurial > hg > drupalISMI
diff relation_processor/FeedsRelationProcessor.inc~ @ 5:1c73c660c2f2
new relation_processor
author | Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 17 Jun 2015 18:55:14 +0200 |
parents | 124ef8f3b22d |
children |
line wrap: on
line diff
--- a/relation_processor/FeedsRelationProcessor.inc~ Fri Mar 27 19:21:42 2015 +0100 +++ b/relation_processor/FeedsRelationProcessor.inc~ Wed Jun 17 18:55:14 2015 +0200 @@ -45,7 +45,7 @@ $relation = new stdClass(); $relation->is_new = TRUE; - dpm($this->bundle()); + $relation->relation_type = $this->bundle(); $relation->uid = $this->config['author']; $relation->endpoints[LANGUAGE_NONE] = Null; @@ -137,6 +137,7 @@ * Save a node. */ public function entitySave($entity) { + dpm($entity); relation_save($entity); } @@ -197,6 +198,22 @@ $form = parent::configForm($form_state); $author = user_load($this->config['author']); + + + $options =$this->bundleOptions(); + $form['bundle'] = array( + '#type' => 'select', + '#options' => $options, + '#title' => !empty($info['bundle name']) ? $info['bundle name'] : t('Bundle'), + '#required' => false, + '#description' => t('if set to generic, relation_name has to be one of the mappings'), + '#default_value' => "generic", + ); + + + + + $form['author'] = array( '#type' => 'textfield', '#title' => t('Author'), @@ -283,7 +300,8 @@ */ public function getMappingTargets() { $type = relation_type_load($this->bundle()); - + dpm("MAPT"); + dpm($type); $targets = parent::getMappingTargets(); $targets['source_id'] = array( @@ -359,8 +377,9 @@ //$entity_type = $this->entityType(); $entity_type = "relation"; $bundle = $this->bundle(); - drupal_alter('feeds_processor_targets', $targets, $entity_type, $bundle); - + dpm("ALTER"); + #drupal_alter('feeds_processor_targets', $targets, $entity_type, $bundle); + relation_feeds_processor_targets_alter($targets, $entity_type, $bundle); return $targets; }