Problem/Motivation
Do not allow multi flagging when Flag Entry Form is selected as a Link type
Steps to reproduce
Create a new Flag with the Link type set to Field Entry Form. Go to node that is allowed to be flagged and copy the link of the "flag/bookmark", should be something like: /flag/details/flag/{flag_machine_name}/{node_id} so if your flag name is bookmark and you're node is is 1, the link is then /flag/details/flag/bookmark/1
For easier testing and distinction add a field to your Flag.
You could add multiple flags to the same node with the same user. Results can be seen with the default "my bookmarks" view.
Bug discovered in #3401111: Editing/Removing a specific flagging is not possible when you have multiple flaggings on the same entity.
Proposed resolution
Check if entity is already flagged and instead of adding a new flag, provide the edit of the existing one.
Issue fork flag-3552858
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
deaom commentedAdded additional check to not create a new flagging if it already exists. This then mean that if link is copied the edit dialog will be displayed, this preventing multiple flags being added to the same node. Needs review.
Comment #5
ivnishI tested it manually, it works as expected
Comment #7
ivnish