You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(uc.ConversationID) from GDN_UserConversation uc where uc.Conversati' at line 2"
Recalculate Conversation.CountParticipants result in invalid SQL
CountParticipants option is using a sub query which refers to c.CountParticipants but c is not defined in that select statement.
update GDN_Conversation set c.CountParticipants=(select count(uc.ConversationID) from GDN_UserConversation uc where uc.ConversationID = c.ConversationID and uc.Deleted = 0);
this would result in the following error if run manually
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(uc.ConversationID) from GDN_UserConversation uc where uc.ConversationID = c.ConversationID and uc' at line 1
While you could argue the update statement defines c. c needs to be defined in the subquery to be understood. MySQL Update even supports joins or better still split it up into two statements.
Vanilla info
Are you sure this is a core Vanilla problem and not caused by any addon you are using? yes
Did you follow our generic troubleshooting steps already? yes
What Vanilla version are you using? 2021.012
When did the issue start? when run /dba/counts Recalculate Conversation.CountParticipants
To Reproduce
Steps to reproduce the behavior:
Go to /dba/counts
click on Recalculate Conversation.CountParticipants
Start
Expected behavior
for count to update correctly without error
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I built 2023.001 this morning from source and this seems to be fixed in this release. Have uploaded the release here if you'd like to download (it works out-of-the-box on PHP 8.1.12 + PHP 8.2.1 without any workarounds!)
Describe the bug
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(uc.ConversationID) from GDN_UserConversation uc where uc.Conversati' at line 2"
Recalculate Conversation.CountParticipants result in invalid SQL
CountParticipants option is using a sub query which refers to c.CountParticipants but c is not defined in that select statement.
vanilla/applications/conversations/models/class.conversationmodel.php
Lines 80 to 88 in cb6f17d
results is a query like so
update GDN_Conversation set c.CountParticipants=(select count(uc.ConversationID) from GDN_UserConversation uc where uc.ConversationID = c.ConversationID and uc.Deleted = 0);
this would result in the following error if run manually
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(uc.ConversationID) from GDN_UserConversation uc where uc.ConversationID = c.ConversationID and uc' at line 1
While you could argue the update statement defines c. c needs to be defined in the subquery to be understood. MySQL Update even supports joins or better still split it up into two statements.
Vanilla info
To Reproduce
Steps to reproduce the behavior:
Expected behavior
for count to update correctly without error
The text was updated successfully, but these errors were encountered: