Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit fbedb3f

Browse files
committed
Allow 0 as a term name.
1 parent f288fbc commit fbedb3f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

mappers/taxonomy.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ function taxonomy_feeds_processor_targets_alter(&$targets, $entity_type, $bundle
7878
* @todo Do not create new terms for non-autotag fields.
7979
*/
8080
function taxonomy_feeds_set_target($source, $entity, $target, $terms, $mapping = array()) {
81-
if (empty($terms)) {
81+
82+
// Allow mapping the string '0' to a term name.
83+
if (empty($terms) && $terms != 0) {
8284
return;
8385
}
8486

plugins/FeedsTermProcessor.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class FeedsTermProcessor extends FeedsProcessor {
4242
* Validates a term.
4343
*/
4444
protected function entityValidate($term) {
45-
if (empty($term->name)) {
45+
if (drupal_strlen($term->name) == 0) {
4646
throw new FeedsValidationException(t('Term name missing.'));
4747
}
4848
}

0 commit comments

Comments
 (0)