Tag state loaded for first user in tag_user
table instead of logged-in user in ShowTagController
#4007
Labels
tag_user
table instead of logged-in user in ShowTagController
#4007
Current Behavior
The tag state is being loaded for the first user in the database instead of the currently logged-in user. This issue affects extensions like Follow Tags that rely on eager loading of the tag state, causing them to not function correctly.
See: FriendsOfFlarum/follow-tags#72 (comment)
Steps to Reproduce
Expected Behavior
The subscription state of tags should be loaded for the currently logged-in user, ensuring that extensions like Follow Tags work as expected.
Screenshots
Modified vendor/flarum/tags/src/Api/Controller/ShowTagController.php to display some info:
![image](https://private-user-images.githubusercontent.com/25438601/347810184-8a4cec07-de8e-43ea-88b4-dc3785a74975.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzcxNDksIm5iZiI6MTczOTE3Njg0OSwicGF0aCI6Ii8yNTQzODYwMS8zNDc4MTAxODQtOGE0Y2VjMDctZGU4ZS00M2VhLTg4YjQtZGMzNzg1YTc0OTc1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA4NDA0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkMjM1MDcyMmNiNjNkOGJlNGY0Y2E3YmQ1YTA0YzcwNjE1ZWMyYmUwNGQyNjc4Yjc1ODAyY2U1OTEyZTAwZWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.om3DGSPdtChqEZe75G_w8tYDrtKp2j8lMqSw6nHnZWY)
Environment
Additional Context
This issue was initially identified while troubleshooting an issue with the Follow Tags (v1.2.3) extension.
The problem lies in this controller: ShowTagController
framework/extensions/tags/src/Api/Controller/ShowTagController.php
Line 72 in 2a693db
The text was updated successfully, but these errors were encountered: