Skip to content
Snippets Groups Projects
Commit a9382ed3 authored by Chris Leppanen's avatar Chris Leppanen
Browse files

Use entity type if entity label is not set.

parent 4f04b96a
No related branches found
No related tags found
No related merge requests found
...@@ -15,12 +15,14 @@ function feeds_rules_event_info() { ...@@ -15,12 +15,14 @@ function feeds_rules_event_info() {
$config = $importer->getConfig(); $config = $importer->getConfig();
$processor = feeds_plugin($config['processor']['plugin_key'], $importer->id); $processor = feeds_plugin($config['processor']['plugin_key'], $importer->id);
$entity_type = $processor->entityType(); $entity_type = $processor->entityType();
$label = isset($entity_info[$entity_type]['label']) ? $entity_info[$entity_type]['label'] : $entity_type;
$info['feeds_import_'. $importer->id] = array( $info['feeds_import_'. $importer->id] = array(
'label' => t('Before saving an item imported via @name.', array('@name' => $importer->config['name'])), 'label' => t('Before saving an item imported via @name.', array('@name' => $importer->config['name'])),
'group' => t('Feeds'), 'group' => t('Feeds'),
'variables' => array( 'variables' => array(
$entity_type => array( $entity_type => array(
'label' => t('Imported @label', array('@label' => $entity_info[$entity_type]['label'])), 'label' => t('Imported @label', array('@label' => $label)),
'type' => $entity_type, 'type' => $entity_type,
// Saving is handled by feeds anyway (unless the skip action is used). // Saving is handled by feeds anyway (unless the skip action is used).
'skip save' => TRUE, 'skip save' => TRUE,
......
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