Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The revision log entries for nodes are hardcoded on insert.
$node->log = 'Created by FeedsNodeProcessor';
and update:
if ($this->config['update_existing'] == FEEDS_UPDATE_EXISTING) {
$node->log = 'Updated by FeedsNodeProcessor';
}
else {
$node->log = 'Replaced by FeedsNodeProcessor';
}
Adding a target to the FeedsNodeProcessor plugin allows one to map to the node's log entry:
$targets['log'] = array(
'name' => t('Log'),
'description' => t('The revision log entry for this insert or update.'),
);
Comment | File | Size | Author |
---|---|---|---|
#2 | feeds-map_node_log-2848592-2.patch | 653 bytes | stupiddingo |
|
Comments
Comment #2
stupiddingo CreditAttribution: stupiddingo as a volunteer commentedComment #3
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedOops. I had missed this one. The new target should have an automated test, which could be added to the existing node processor test class.
@stupiddingo
Do you like to write a test for this target? The test should cover two cases: ensure a revision log entry is set when creating a node and when updating a node. If you are not familiar with writing tests, would you like to get help with that?