I'm looking for a way to trigger the hook entry_submission_ready on every entry that the Solspace Importer imports. I have another extension that, upon entry_submission_ready, manipulates entry data. In this case, the other extension takes a plaintext address, geocodes it, and inserts the geocoded address back into the entry data.
Importer disables extension hook triggers when it imports, and as the comments explain: (../importer/content_types/importer.content_type.channel_entries/content_type.channel_entries.php:starting-line 627)
// --------------------------------------------
// Disable Extensions
// - Extension can cause ALL sorts of headaches
// when using the EE Channel Entries API.
// --------------------------------------------
$allow_extensions = ee()->config->item('allow_extensions');
ee()->config->config['allow_extensions'] = 'n';
// -------------------------------------
// This is a fix for Extensions->active_hook
// returning boolean true even when extensions
// are disabled. EE Bug reported.
// This should be fixed in EE 2.9.1/2.10.0.
// -------------------------------------
$old_ext = ee()->extensions->extensions;
ee()->extensions->extensions = array();
The extension triggers cause headaches. And so they do: the geocode extension throws an error if I allow extensions to remain enabled during the import. I could get around this by writing my own extension that is triggered after the importer is completely finished, and having that extension loop over all recently added entries and just triggering the entry_submission_ready hook. However, Solspace Importer does not have any (documented or otherwise) hooks for when it's completely finished.
This leaves me with my data imported, but having to go to Edit each individual entry, and just submit an unchanged Edit form so it triggers entry_submission_ready and the geocoder extension does it's thing. I'd love a better programmatic way to handle this, as getting the data import for this project right is about 90% of the work (it's a glorified blog project for a client with tons of csv data). Any help or suggestions would be awesome! Thanks!