Closed (fixed)
Project:
Flag
Version:
7.x-2.x-dev
Component:
Flag core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Apr 2013 at 17:22 UTC
Updated:
16 Oct 2013 at 07:54 UTC
Jump to comment: Most recent file
Comments
Comment #1
joachim commentedThanks for reporting this.
Will probably need fixing on 3.x first.
Comment #2
Volx commentedI finally got around to fixing this problem. Actually Flag is using its own hook wrongly. Per flag.api.php hook_flag_definitions_alter should be used to alter flag definitions provided by other modules, but flag_flag_definitions_alter actually adds _new_ definitions. If the alter hook would be allowed to add definitions, determining what module actually provides a definition is overly complicated. So flag should add flag definitions for entities not already provided for, not in the alter hook but in flag_fetch_definitions.
So assuming that flag is the only module adding definitions outside of hook_flag_definitions, we can simply check for any entities that have not been provided for and safely assume that Flag is the providing module. That is what the patch below does.
The patch applies to 7.x-2.0. A patch for 7.x-3.x-dev will follow.
Comment #3
Volx commentedThere is a small error in the patch above, here is a better one.
Comment #4
Volx commentedAnd here is the proposed patch for 3.x-dev. For the problem mentioned above, I created a new minor issue here #2070187: Fix misuse of hook_flag_type_info_alter.
Comment #5
joachim commentedUrgh, that bit of flag always makes my head hurt. I just had to go remind myself why flag_features_providing_module() can't just call flag_fetch_definition()!
Comment #6
joachim commentedDoes it matter that vocabs aren't flaggable?
(If you need to reroll for this, can you also wrap the comment to 80 lines please?)
Comment #7
joachim commentedTagging as 3.1 blocker.
Comment #8
Volx commentedI already exclude 'taxonomy_vocabulary'
But I fixed the comment length.
Comment #9
joachim commentedCommitted, with a tweak to the comment wrapping.
Thanks for all your work on this.
git commit -m "Issue #1971980 by Volx: Fixed Features export not taking into account provision of flag types by flag_definition_alter()." --author="Volx "
Comment #10
japerryIs it possible to get this backported and committed to Flag 2.x ?
Comment #11
joachim commentedIf someone provides a patch, and it gets reviewed, I'll commit it.
Comment #12
japerrythe patch in #3 fixed the error for me on flag 2.x
Comment #13
japerrysee #12 and #3 for patching flag 2.x
Comment #14
joachim commentedCherry-picked. Thanks for testing!