There are a lot of modules that extend feeds importers however I can't see a way to hook into the process of deleting an importer.

Could we add a hook so that other modules can clean up additional configuration or do whatever else they need to do?

Comments

rooby created an issue. See original summary.

megachriz’s picture

This sounds like a good idea. I have however one concern: an importer can be exported to code. When an importer exists in both code as in the database a 'deletion' will actually revert the importer. In this case I think the delete importer hook should not be invoked (but maybe a revert hook instead). There is another thing: when a module providing the importer in code gets disabled, the importer disappears as well. So maybe the delete hook should run as well when that module gets uninstalled? I think disabling a module should not result into data loss.

How does the View module does this? Views also has the concept of adding their config into code.

rooby’s picture

Good point, I hadn't really considered exportables or thought of the views module.

The views object delete method calls hook_views_view_delete() at the end.

It doesn't appear to differentiate between a delete and a revert, so the condition would have to be that all extra data be stored on the object such that reverting to code wouldn't lose that additional configuration.
Besides, if you were providing a default configuration it would be good to be able to also specify additional third party configuration in that code also, like different views plugins do.

I also considered the crop approach, as per the linked issue about feeds_source.
That might be the only solution for extras that couldn't possibly go in the importer configuration itself. Well that and just leaving the extras in the database until the module in uninstalled.

bluegeek9’s picture

Status: Active » Closed (outdated)
//www.flaticon.com/free-icons/thank-you Thank you for your contribution!

Unfortunately, Drupal 7 is End of Life and no longer supported. We strongly encourage you to upgrade to a supported version of Drupal.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.