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

Command icon 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

deaom created an issue. See original summary.

deaom’s picture

Status: Active » Needs review

Added 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.

ivnish made their first commit to this issue’s fork.

ivnish’s picture

I tested it manually, it works as expected

  • ivnish committed 6dc07ce9 on 5.x authored by deaom
    fix: #3552858 Do not allow multiple flaggings when Field Entity Form is...
ivnish’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.