This seems to be related to
this issue
✨
Views hooks not executed
Fixed
.
The data export display is not being rendered and therefore some hooks are not executed. The views data export module includes a hook for this: hook_views_data_export_row_alter
Here is an example:
function my_module_views_data_export_row_alter(&$row, \Drupal\views\ResultRow $result, \Drupal\views\ViewExecutable $view) {
if ($view->id() == 'my_view') {
$node = $result->_entity; // Get the node object
$data = getData($node);
foreach ($row as $key => &$value) {
if (str_contains($key, 'nothing')) {
$value = setCustomValue($data, $key);
}
}
}
}
I was able to make the migration work by using patch #52 and following a similar approach as described in #59.
Instead of migration_lookup, I used the entity_lookup plugin.
I added the following code to the migrations/d7_flagging.yml
file:
entity_id:
- plugin: entity_lookup
entity_type: node
value_key: nid
bundle: 1
bundle_key: status
source: entity_id
- plugin: skip_on_empty
method: row
In this case, it looks up all nodes for a matching entity id.