Issue with multiple buttons on a View

Created on 17 April 2024, about 1 year ago
Updated 10 May 2024, 12 months ago

Firstly, thanks for a great little module - very effective!

I've added a Like button to 2 custom twig templates for my nodes - one template is for the full node display and the other is for a display type called Grid which is used to show the results in Views.

The button on individual nodes works perfectly but I'm having issues with the ones in the View.

The View displays multiple nodes of the same type. All nodes show the Like button as expected and the form ID (like-form-node-xxx) is different on each Like button too. Any content I've previously liked on individual node pages stays flagged as Liked on the View. All good so far.

The issue comes when I start trying to Like multiple items in the View. I click the Like button on a first unliked item in the View. When I click it, the Like highlights as expected and it saves fine too and can be seen in the list at /admin/content/like. If I now click another Like button on a different node in the same View though, that button initially turns to Liked but then immediately refreshes again and goes back to showing as Unliked. If I now refresh the page, both that AND the previous Like I clicked in the view are showing as unlike and the first Liked item has also disappeared from the admin list too.

I'm wondering if there's some sort of clash with having the multiple different Like forms on one page perhaps? It's as if clicking the second button actually acts as if the first button has been clicked again, causing it to become unlike again.

The View itself is fairly standard with the Show settings set to Content and then the Grid display type selected. I've tried it with Ajax on and off and the same issue occurs in both scenarios.

Hope this all makes sense. Unfortunately, the site I'm working on isn't public yet otherwise I'd share the link to see/test for yourself.

πŸ› Bug report
Status

Active

Version

2.0

Component

User interface

Created by

πŸ‡¬πŸ‡§United Kingdom ttesteve

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024