Closed (fixed)
Project:
Feeds
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 May 2015 at 14:45 UTC
Updated:
24 Jun 2016 at 08:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
megachrizWell that's an interesting bug! :D By having both a Feeds importer and a Feeds plugin (the Ubercart Addresses processor) Ubercart Addresses now gets a dependency on itself when Feeds is enabled!
It's actually a bug in Feeds, so I move this issue to that project. I even helped with the piece that introduced this bug :$, see #2379407: Make module required if plugins are in use..
To clarify the issue: the dev version of Feeds checks if plugins provided by modules are in use by importers and if so, it makes the module that provides the plugin required so it can't be disabled. This helps to prevent missing plugin warnings. In this process it doesn't take in account that these importers could be provided by the same module that provided the plugin.
The attached patch skips the plugin usage check for importers that are defined in code. This should fix the problem, though it partly undoes #2379407: Make module required if plugins are in use..
Comment #2
twistor commentedCan't we check the provider information from FeedsPlugin::getDefinition() and check if it's the same as the current module?
Comment #3
megachrizThis patch checks per importer that is defined in code by which module that it is defined. Whether or not that importer uses a plugin defined by the same module is not checked (and shouldn't be). The module in question shouldn't be marked as required via an importer from itself. If an other importer - that is not defined by that module - uses a plugin of that module, the module gets marked as required as yet. Thus if a module has an importer that uses a Feeds plugin from itself becomes irrelevant.
Let me illustrate the process with an example. Say we have the following modules that define plugins and importers:
Drupal invokes
hook_system_info_alter()for each module on the system. When this hook is invoked for the Foo module, Feeds will do the following per importer:So the Foo module is allowed to be disabled.
Let's check the same for the Bar module:
So the Bar module is NOT allowed to be disabled. You see here that the fact that the Bar module also defines an importer that uses a Bar plugin is not relevant, Bar becomes required because of the QuxImporter.
And finally, this are the checks for the Qux module.
So the Qux module is allowed to be disabled.
This illustrates that:
I think this patch is ready and correctly fixes the problem without undoing anything from #2379407: Make module required if plugins are in use..
In the patch I also removed the ending dot from the explanation messages because the other "Required by" strings don't end in a dot either, note that the Field module also doesn't end the explanation messages with a dot.
Comment #5
twistor commentedThat makes sense.
Just moved the comment up a bit to cover the whole part of the relevant code.
Comment #7
pikot commentedHi, I have applied the patch and the message "Feeds is currently using this module for one or more importers" still it appears, and I can't uninstall the module.
Comment #8
pikot commentedComment #9
megachriz@pikot
The patch in question is already committed. If you cannot disable/uninstall a module, then you must have importers in use that make use of a plugin provided by that module. Delete the importers in question (or change fetcher, parser or processor of these importers) and try again. If you are sure that there is a bug, please carefully read #3 of this issue first to ensure the same thing applies in your situation: importer + plugin are provided by the same module. If your situation is different, please open a new issue and explain what the bug is.
Comment #10
pikot commented@MegaChriz
Thanks! I changed the parser and I have been able to disable the module.