- Issue created by @oriolroger
- 🇳🇱Netherlands megachriz
No, I think there isn't a way to disable it.
One possible workaround is perhaps the following:
- Create a dummy class implementing FeedsAccountSwitcherInterface.
- Create a class extending FeedsSource. Override the constructor and set
$this->accountSwitcher
to an instance of your class that implements FeedsAccountSwitcherInterface. - Set the variable "feeds_source_class" to the name of your class that extends FeedsSource.
Note that the current user will then be anonymous during cron imports. That's why the account switch was implemented: to make importing through the UI consistent with importing through cron.
An other way to solve your issue could perhaps be the following:
- Attach your importer to a content type.
- When saving the feed node, save the current user ID on a field of that node. You'll then should have access to that user ID when loading the feed node.
- Maybe you need to implement form alters for the import form that update the user ID on the feed node.
- 🇳🇱Netherlands megachriz
But I'm open to adding an option on the feeds importer to specify the user to switch to or to not switch at all. But the option to disable user switches should note that imports will run as user 0 on cron imports when using the standalone form.