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.
Fatal Error in Unknown column 'd.DiscussionID' in 'on clause'
camo
New
Getting This error when clicking Tags links in 'popular tags'. Dont know what it means or how to fix it, please help?
Fatal Error in Gdn_Database.Query();
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 ('6')
order by c.TreeLeft asc
limit 15
The error occurred on or near: /forum/library/database/class.database.php
283: $PDOStatement = $this->Connection()->query($Sql);
284: }
285:
286: if ($PDOStatement === FALSE) {
287: trigger_error(ErrorMessage($this->GetPDOErrorMessage($this->Connection()->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
288: }
289:
290: // Did this query modify data in any way?
291: if ($ReturnType == 'ID') {
Variables in local scope:
[Sql] '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 (\'6\')
order by c.TreeLeft asc
limit 15'
[InputParameters] array (
)
[Options] array (
'ReturnType' => 'DataSet',
)
[ReturnType] 'DataSet'
[PDOStatement] false
************************************
ALSO THIS ERROR ON Click delete from 'options' in discussions veiw....
Unknown column 't.Type' in 'where clause'
select t.*
from GDN_TagDiscussion td
join GDN_Tag t on td.TagID = t.TagID
where td.DiscussionID = :tdDiscussionID
and t.Type = :tType
The error occurred on or near: /s101-2/home6/camosreptiles/forum/library/database/class.database.php
276:
277: if (!is_object($PDOStatement)) {
278: trigger_error(ErrorMessage('PDO Statement failed to prepare', $this->ClassName, 'Query', $this->GetPDOErrorMessage($this->Connection()->errorInfo())), E_USER_ERROR);
279: } else if ($PDOStatement->execute($InputParameters) === FALSE) {
280: trigger_error(ErrorMessage($this->GetPDOErrorMessage($PDOStatement->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
281: }
282: } else {
283: $PDOStatement = $this->Connection()->query($Sql);
284: }
Variables in local scope:
[Sql] 'select t.*
from GDN_TagDiscussion td
join GDN_Tag t on td.TagID = t.TagID
where td.DiscussionID = :tdDiscussionID
and t.Type = :tType'
[InputParameters] array (
':tdDiscussionID' => '31',
':tType' => '',
)
[Options] array (
'ReturnType' => 'DataSet',
)
[ReturnType] 'DataSet'
[PDOStatement] array (
'queryString' => 'select t.*
from GDN_TagDiscussion td
join GDN_Tag t on td.TagID = t.TagID
where td.DiscussionID = :tdDiscussionID
and t.Type = :tType',
)
Fatal Error in Gdn_Database.Query();
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 ('6')
order by c.TreeLeft asc
limit 15
The error occurred on or near: /forum/library/database/class.database.php
283: $PDOStatement = $this->Connection()->query($Sql);
284: }
285:
286: if ($PDOStatement === FALSE) {
287: trigger_error(ErrorMessage($this->GetPDOErrorMessage($this->Connection()->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
288: }
289:
290: // Did this query modify data in any way?
291: if ($ReturnType == 'ID') {
Variables in local scope:
[Sql] '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 (\'6\')
order by c.TreeLeft asc
limit 15'
[InputParameters] array (
)
[Options] array (
'ReturnType' => 'DataSet',
)
[ReturnType] 'DataSet'
[PDOStatement] false
************************************
ALSO THIS ERROR ON Click delete from 'options' in discussions veiw....
Unknown column 't.Type' in 'where clause'
select t.*
from GDN_TagDiscussion td
join GDN_Tag t on td.TagID = t.TagID
where td.DiscussionID = :tdDiscussionID
and t.Type = :tType
The error occurred on or near: /s101-2/home6/camosreptiles/forum/library/database/class.database.php
276:
277: if (!is_object($PDOStatement)) {
278: trigger_error(ErrorMessage('PDO Statement failed to prepare', $this->ClassName, 'Query', $this->GetPDOErrorMessage($this->Connection()->errorInfo())), E_USER_ERROR);
279: } else if ($PDOStatement->execute($InputParameters) === FALSE) {
280: trigger_error(ErrorMessage($this->GetPDOErrorMessage($PDOStatement->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
281: }
282: } else {
283: $PDOStatement = $this->Connection()->query($Sql);
284: }
Variables in local scope:
[Sql] 'select t.*
from GDN_TagDiscussion td
join GDN_Tag t on td.TagID = t.TagID
where td.DiscussionID = :tdDiscussionID
and t.Type = :tType'
[InputParameters] array (
':tdDiscussionID' => '31',
':tType' => '',
)
[Options] array (
'ReturnType' => 'DataSet',
)
[ReturnType] 'DataSet'
[PDOStatement] array (
'queryString' => 'select t.*
from GDN_TagDiscussion td
join GDN_Tag t on td.TagID = t.TagID
where td.DiscussionID = :tdDiscussionID
and t.Type = :tType',
)
0
Answers
http://vanillaforums.org/discussion/17228/unknown-column-when-clicking-tag/p1
Prepare as much information as you can for a bug report on gitHub. We need to figure out whether the programmers want a bug report on gitHub or here on the forum, since it's related to the Tagging plugin, but also related to Discussions.
There was an error rendering this rich post.
@Lincoln
ran utility update + success, but still getting exact same error when clicking tags links in 'popular tags'.
@UnderDog Im pretty sure the second issue is due to the first, and that the first is because Ive messed my DB rather than a code bug.
The issue you see is because the table with discussions isn't in the query. If you look in the other thread you will see the query I'm talking about.
This issue only comes up if you have the view set to a certain setting (for example "Categories only" or "Categories and Discussions" and then try to access one single tag. In your case where td.TagID in ('6')
The second issue Unknown column 't.Type' in 'where clause' is because the field "type" isn't present in the TagDiscussion table.
There are many many ways to resolve that problem.
I do have the feeling that the RC version of Vanilla will be announced soon. If you do a clean install on a separate location (maybe your local PC) that's the quickest way to resolve that problem.
Fixed the double save for you :-)
There was an error rendering this rich post.
Ok I installed XAMPP 1.7.7.win 32 and successfully installed there, but the problem remains on my original database. Did you mean just start again on my local host? Or something you forgot to tell me? I dont want to start again, I have a great server host and people know where we are already. Is there another fix for the error above?
http://localhost/vanilla/index.php?p=/
Can I export the Tag related tables from the localhost installation then import to my original database?
@UnderDog
Upgraded to 2.0.18 RC2 but problem remains, please comment on last question re export/import of tag tables?
Export the structure of the messed up tag table
Export the structure of the tag table of RC2
Compare those structures, there should be a difference.
Hopefully it's only the "type" field that's missing from the messed up tag table
in that case, add that single field.
Does the messed up tag table have any entries?
Just for fun, you can try and copy the messed up Vanilla install from your host to your localhost. You can for example put it in the directory "vanilla_mess" and the table could be "vanilla_mess"
You have to make some changes in the config file of "vanilla_mess" once you've copied it from your webhost to your localhost and you have to change the config table.
Search on the forums, there's some posts about this in the forum and in the documentation.
Now you have a messed up install on your localhost, you can try to fix your messed up install locally and then you know what you need to do on your server to fix the problem there.
There was an error rendering this rich post.
So I need to export the tag table structure from my local host install, then export the messed up tag table structure from my RC2 install and compare, yes?
Then add the missing feild from the localhost install to the database in my original install ?
Yes, the original install has 4 tags, should I delete those first?
OK heres the local host tables for Tag (no tag entries) Heres the original (messed up/4 tag entries)
done but no change....
/utility/update don't help
The problem appears only when I'm in guest roles on the site. When I admin - tags are working correctly.
Im now getting the exact same error I opened this topic with.
Might the following work?
1. disable taggle
2. remove tagging
3. empty all tag related database tables
4 reupload tagging plugin
5. re-enable
6. utility update
?