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.
unknown column when clicking tag
carlokok
New
After updating to 2.0.18b4 (2.0.18 branch on github) I'm getting the following error when clicking a tag, what am I missing?
Unknown column 'd.DiscussionID' in 'on clause'
select c.*, lc.DateInserted as `DateLastComment`
from GDN_Category c
join GDN_TagDiscussion td on d.DiscussionID = td.DiscussionID
left join GDN_Comment lc on c.LastCommentID = lc.CommentID
where td.TagID in ('37')
order by c.TreeLeft asc
limit 50
/connect/library/database/class.database.phpPHP::Gdn_ErrorHandler();
[/connect/library/database/class.database.php:287] PHP::trigger_error();
[/connect/library/database/class.sqldriver.php:1650] Gdn_Database->Query();
[/connect/library/database/class.sqldriver.php:676] Gdn_SQLDriver->Query();
[/connect/applications/vanilla/models/class.categorymodel.php:90] Gdn_SQLDriver->Get();
[/connect/applications/vanilla/models/class.discussionmodel.php:445] CategoryModel::Categories();
[/connect/applications/vanilla/models/class.discussionmodel.php:55] DiscussionModel::CategoryPermissions();
[/connect/applications/vanilla/models/class.discussionmodel.php:136] DiscussionModel->DiscussionSummaryQuery();
[/connect/plugins/Tagging/class.tagging.plugin.php:106] DiscussionModel->Get();
[/connect/library/core/class.pluginmanager.php:713] TaggingPlugin->DiscussionsController_Tagged_Create();
[/connect/library/core/class.dispatcher.php:313] Gdn_PluginManager->CallNewMethod();
[/connect/index.php:53] Gdn_Dispatcher->Dispatch();
Tagged:
0
Answers
(no idea what that is, it showed up on google when searching for the error)
applications/vanilla/models/class.categorymodel.php
go to line 90
Then copy and paste the Get() function in this thread please?
There was an error rendering this rich post.
There's a plugin called the Tagging plugin. In the event that's executed before the Get() function (which is strange, but ok...) you will have this function:
public function DiscussionModel_BeforeGet_Handler($Sender) { if (C('Plugins.Tagging.Enabled') && property_exists($Sender, 'FilterToTagID')) $Sender->SQL->Join('TagDiscussion td', 'd.DiscussionID = td.DiscussionID and td.TagID = '.$Sender->FilterToTagID); }
I will look further if there's another piece of code with the tagDiscussion table, but it looks like this piece of code gives the troubles.By the way... the piece of code isn't wrong it just doesn't belong in the query that you showed in the original error.
Also... I see that you're requesting for a specific tag. That's good for the problem description, once this will be registered as a bug.
There was an error rendering this rich post.
http://screencast.com/t/60wsIqGpDQ << video
The plugin used here is: https://github.com/vanillaforums/Garden/tree/master/plugins/Tagging
@carlokok You may have an incompatable veriosn of tagging, what is the contents of
DiscussionsController_Tagged_Create do you have 'FilterToTagIDs' there and in DiscussionModel_BeforeGet_Handler?
Something has gone wrong somewhere, becuase in my version there is not Join with Tag, instead that is called separately to get the TagIDs then that is used to get the data from the model. I think you are using the wrong version of tagging.
grep is your friend.
https://github.com/vanillaforums/Garden/blob/master/plugins/Tagging/class.tagging.plugin.php
)
I noticed this doesn't happen all the time. 1 colleague can reproduce it in IE but not Chrome; I had it in chrome the other day but it doesn't show now; it's like it depends on a specific option or origin or something.
grep is your friend.
I think it is better becuase it doesn't rely on joins. Query can be build with additions from multiple plugins, you can end up with quite a monstrosity of a query. That might be what is happening here. I tend to stick to wheres and the like, only doing joins where absolutely necessary.
grep is your friend.