Skip to content
Snippets Groups Projects
Commit af0ad176 authored by Alex Barth's avatar Alex Barth
Browse files

#795114 budda, alex_b: Taxonomy term processor doesn't require vocabulary to be set.

parent ecaa6dfe
No related branches found
No related tags found
No related merge requests found
// $Id$ // $Id$
Feeds 6.x xxxxxxxxxxxxxxxxxxxxxx
--------------------------------
- #795114 budda, alex_b: Taxonomy term processor doesn't require vocabulary to
be set.
Feeds 6.x 1.0 Beta 5, 2010-09-10 Feeds 6.x 1.0 Beta 5, 2010-09-10
-------------------------------- --------------------------------
......
...@@ -118,7 +118,9 @@ class FeedsTermProcessor extends FeedsProcessor { ...@@ -118,7 +118,9 @@ class FeedsTermProcessor extends FeedsProcessor {
if (!$target_term) { if (!$target_term) {
$target_term = array(); $target_term = array();
} }
$vocabulary = $this->vocabulary(); if (!$vocabulary = $this->vocabulary()) {
throw new Exception(t('No vocabulary specified for term processor.'));
}
$target_term['vid'] = $vocabulary->vid; $target_term['vid'] = $vocabulary->vid;
$target_term = parent::map($batch, $target_term); $target_term = parent::map($batch, $target_term);
// Taxonomy module expects synonyms to be supplied as a single string. // Taxonomy module expects synonyms to be supplied as a single string.
...@@ -174,6 +176,15 @@ class FeedsTermProcessor extends FeedsProcessor { ...@@ -174,6 +176,15 @@ class FeedsTermProcessor extends FeedsProcessor {
return $form; return $form;
} }
/**
* Override parent::configFormValidate().
*/
public function configFormValidate(&$values) {
if (empty($values['vocabulary'])) {
form_set_error('vocabulary', t('Choose a vocabulary'));
}
}
/** /**
* Return available mapping targets. * Return available mapping targets.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment