Closed (fixed)
Project:
Flag
Version:
7.x-3.x-dev
Component:
Flag core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Jan 2013 at 16:30 UTC
Updated:
31 Mar 2014 at 07:01 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
zxaos commentedPatch attached
Comment #2
zxaos commentedOops, setting as needs review.
Comment #4
joachim commentedentity_type_supports() is only called by our CTools plugins.
Bit annoying that nobody noticed when this was committed recently, but at any rate, we can fix this by adding a module_exists() in flag_ctools_plugin_directory(), rather than adding the dependency wholesale.
Comment #5
joachim commentedComment #6
fahime commented#1: flag-missing-entity-dependency-1882258-1.patch queued for re-testing.
Comment #7
joachim commentedI don't think the patch is the right approach -- see #4.
Comment #8
dsdeiz commentedI added the
module_exist()in the plugin file itself instead of what was suggested in #1882258-4: CTools plugins depend on Entity module because perhaps there might be additional content type plugins in the future that wouldn't depend on entity module.Comment #9
dsdeiz commentedComment #10
joachim commentedPatch looks fine.
Though now I look at the plugin in question, I see that the only thing from Entity API that it uses is the call to entity_type_supports() in hook_PLUGIN_content_type_content_types(), which is the place where we define which entity types we're available for.
Is there a way we can do without this? Since the actual rendering doesn't need Entity API it seems a shame to remove it from sites that don't have it / force them to install it for just this one function call.
Comment #11
dsdeiz commentedHm, yeah. There doesn't seem to be a unified way of determining whether an entity has a view callback or not. Perhaps checking if a
ENTITY_NAME_view()function exists?Comment #12
joachim commented> Perhaps checking if a ENTITY_NAME_view() function exists?
We'd get false negatives -- and maybe even false positives too!
> There doesn't seem to be a unified way of determining whether an entity has a view callback or not.
Indeed.
But what we could do is just offer the plugin, and the presumably the admin user knows whether their entities are viewable or not. If they're not, they're not going to be putting together a panel for that entity type anyway, surely?
Comment #13
dsdeiz commentedI see. I guess if that's the case, I could simply just remove the call to
entity_type_supports()? Patch attached for this.Comment #14
bsandor commentedHi,
Im not an expert in programming, i have some background...
What im sure of is that it took me hours and hours of work finding out what the problem was. (i installed entity api to solve my issue. I believe im not the only one with this problem. Probably many people stopped using this module after having similar issues. I believe at least on modules page should be mentioned this issue. Or an examination if entity api is installed and if not, than poviding the needed function. As im not an expert, especially not drupal expert i don't know the best solutions...
Regards
Comment #15
joachim commentedThanks for the patch. Committed.
git commit -m "Issue #1882258 by dsdeiz: Removed use of Entity API function in CTools content types declaration." --author="dsdeiz "