Closed (outdated)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Flag core
Priority:
Major
Category:
Plan
Assigned:
Unassigned
Reporter:
Created:
18 Jan 2015 at 20:05 UTC
Updated:
7 Feb 2025 at 07:59 UTC
Jump to comment: Most recent
8.x is a complete rewrite of Flag. Many of the key API hooks have been replaced with new mechanisms.
Track the changes in an issue while the rewrite process is ongoing, and close this issue after developer documentation for 8.x has been written.
N/A.
Many, see below.
| Hook Name | Flag 8.x equivalent |
|---|---|
| hook_flag_type_info | Replaced with the @FlagType plugin. |
| hook_flag_type_info_alter | Still exists, using plugin manager. |
| hook_flag_default_flags | Replaced with CMI. |
| hook_flag_default_flags_alter | Replaced with core hook hook_ENTITY_TYPE_load(). |
| hook_flag_alter | Replaced with core hook hook_ENTITY_TYPE_load(). |
| hook_flag_options_alter | Not implemented. A custom flag type plugin may be defined. |
| hook_flag_flag | Replaced with entity flagged event. |
| hook_flag_unflag | Replaced with entity unflagged event. |
| hook_flag_validate | Removed: See #2744307: Implement or remove hook_flag_validate() |
| hook_flag_access | Removed. To be replaced with something else: see #2584647: Flagging access system not extensible. |
| hook_flag_access_multiple | Removed. To be replaced with something else: see #2584647: Flagging access system not extensible. |
| hook_flag_link_type_info | Replaced with @ActionLink plugin |
| hook_flag_link_type_info_alter | Still exists, using plugin manager. |
| hook_flag_link | Replaced with @ActionLink plugin |
| hook_flag_delete | Still exists, as core hook_ENTITY_TYPE_delete(). |
| hook_flag_reset | Resets proved problematic for scaling. Instead, ENTITY_UNFLAGGED may now handle multiple flaggings. |
| hook_flag_javascript_info_alter | Removed: #2744295: Delete hook_flag_javascript_info_alter() |
| hook_flag_export_alter | Not present. Import export functionality replaced by CMI. |
Comments
Comment #1
joachim commentedComment #2
joachim commentedA number of the hooks that the above summary says are no longer present are nonetheless still documented in the api.php file, no?
Comment #3
socketwench commentedProbably. We should go nuke them in a separate issue.
Comment #4
joachim commentedUpping this so we know it's a release blocker.
I spotted hook_flag_alter() today while working on something else. Presumably its functionality can be taken care of by the core hook https://api.drupal.org/api/drupal/core!modules!system!entity.api.php/fun....
Comment #5
joachim commentedComment #6
socketwench commentedUpdated reset event hook.
Comment #7
joachim commentedComment #8
joachim commentedUpdated reset event, delete hooks, access hooks.
Comment #9
socketwench commentedComment #10
socketwench commentedComment #11
socketwench commentedComment #12
socketwench commentedComment #13
joachim commentedComment #14
martin107 commentedAdded hook_token to the table.
#2500091: Re-implement hook_tokens()
Comment #15
joachim commentedhook_token() is not one of our hooks though -- this issue is about the hooks that Flag module invents, not the hooks that Flag implements.
Comment #16
martin107 commentedI can't answer this question with any certainty because it is not a facet of this module I use
but what is the upgrade strategy for someone waiting for the code in flag_tokens.inc's flag_tokens() function to become uncommented.... if there is a better alternate solution then my want is open an issue to simply removed the dead code.
Maybe your line that this is something that can wait until after the beta blockers are complete?
Comment #17
joachim commented> but what is the upgrade strategy for someone waiting for the code in flag_tokens.inc's flag_tokens() function to become uncommented.... if there is a better alternate solution then my want is open an issue to simply removed the dead code.
That's not this issue's concern.
This issue is about the hooks *provided* by Flag, not *implemented* by Flag. All the hooks in the table are called hook_flag_foo(). It's the hooks that developers would have implemented in their own code to customize Flag.
Comment #18
ivnish7 years without any activity. I think we can close it as outdated. Please reopen if needed.