Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Please give the idea how to get Voting plugin working back
This discussion is related to the Voting addon.
As I know this Voting plugin is outdated. Anybody has an idea how to make it compatible with Vanilla 2.8? I am very liked it. I've read here on forum that it need a hacks in Vanila core which is most difficult thing.
Another question if Vanilla stuff is going to do something similar to this plugin in next versions?
And third, if it's possible to do same with YAGA? I mean to sort the comments by the reaction quantity?
Please, give any idea of that 3 issues.
The official (cloud only) reactions allows this type of sorting. Lincoln recently comment on it so I’ll share that with you.
For All who is looking something similar to Voting plugin - you can use a plugin Rating from R_J. It's compatible with 2.8 and I found it very usefull.
SQL query is broken ... in the runtime I have found that following query is trying to execute:
from `GDN_Comment` `c`
where `c`.`DiscussionID` = 1
order by `coalesce(c`.`Score` asc, `0)` desc, `c`.`CommentID` asc
This "asc" is wronlgy parsed.
Following code inside CommentModel_AfterConstruct_Handler:
is later wrongly parsed inside library\database\class.sqldriver.php:
and this produce bad sql
This is a content of $this->_OrderBys:
but indded BUG is inside vanilla forum in library\database\class.sqldriver.php inside "public function orderBy". This line of code:
Variable $fields has a value "coalesce(c.Score, 0)" but after parsing we have this:
So not sure if vanilla forum has a bug or plugin has a bug.
Simplest fix is to replace following line:
inside class.voting.plugin.php and plugin will continue to work, maybe with some anothe unexspecte behaviour but for at a first shot is is working :)
Line 141 is original one and I have commented it and on line 142 is new code which fix the issue:
I am working with vanilla forum 3.3
Just created PR to fix the issue: https://github.com/CreativeDreams/Voting/pull/1