vanillaforums/Garden — Issue #1243: Unknown column 'iu.Email'
Author: elifarley
Created: 2011-11-23 04:36:34+00:00
State: open

After updating to Vanilla 2.0.18.1 and enabling some plugins, I visited the main forum URL, which prompted the error below:

----------------------------------------------
Unknown column 'iu.Email' in 'field list'

select d.Type as `Type`, d.InsertUserID as `FirstUserID`, d.DateInserted as `FirstDate`, d.CountBookmarks as `CountBookmarks`, d.Body as `Body`, d.Format as `Format`, d.DateLastComment as `LastDate`, d.LastCommentUserID as `LastUserID`, d.Score as `Score`, iu.Email as `FirstEmail`, lcu.Email as `LastEmail`, d.*, w.UserID as `WatchUserID`, w.DateLastViewed as `DateLastViewed`, w.Dismissed as `Dismissed`, w.Bookmarked as `Bookmarked`, w.CountComments as `CountCommentWatch`
from GDN_Discussion d
left join GDN_UserDiscussion w on d.DiscussionID = w.DiscussionID and w.UserID = 2
where d.DiscussionID in ('36', '41', '68', '190', '230', '279', '318', '334', '348', '355', '358', '360', '366', '368', '375', '377', '378', '398', '404', '406', '408', '409', '420', '431', '439', '455', '483', '499')
and w.Bookmarked = :wBookmarked
order by d.DateLastComment desc
limit 10

The error occurred on or near: /usr/www/users/my_user/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: }

Backtrace:
/usr/www/users/my_user/library/database/class.database.phpPHP::Gdn_ErrorHandler();
[/usr/www/users/my_user/library/database/class.database.php:280] PHP::trigger_error();
[/usr/www/users/my_user/library/database/class.sqldriver.php:1650] Gdn_Database->Query();
[/usr/www/users/my_user/library/database/class.sqldriver.php:676] Gdn_SQLDriver->Query();
[/usr/www/users/my_user/applications/vanilla/models/class.discussionmodel.php:187] Gdn_SQLDriver->Get();
[/usr/www/users/my_user/applications/vanilla/modules/class.bookmarkedmodule.php:37] DiscussionModel->Get();
[/usr/www/users/my_user/applications/vanilla/modules/class.bookmarkedmodule.php:50] BookmarkedModule->GetData();
[/usr/www/users/my_user/library/core/class.module.php:201] BookmarkedModule->ToString();
[/usr/www/users/my_user/library/core/class.modulecollection.php:34] Gdn_Module->Render();
[/usr/www/users/my_user/library/core/class.controller.php:1187] Gdn_ModuleCollection->Render();
[/usr/www/users/my_user/themes/clean/views/default.master.php:15] Gdn_Controller->RenderAsset();
[/usr/www/users/my_user/library/core/class.controller.php:1564] PHP::include();
[/usr/www/users/my_user/library/core/class.controller.php:1141] Gdn_Controller->RenderMaster();
[/usr/www/users/my_user/library/core/class.pluggable.php:193] Gdn_Controller->xRender();
[/usr/www/users/my_user/applications/vanilla/controllers/class.categoriescontroller.php:196] Gdn_Pluggable->__call();
[/usr/www/users/my_user/applications/vanilla/controllers/class.categoriescontroller.php:196] CategoriesController->Render();
[/usr/www/users/my_user/applications/vanilla/controllers/class.categoriescontroller.php:196] CategoriesController->All();
[/usr/www/users/my_user/library/core/class.dispatcher.php:322] PHP::call_user_func_array();
[/usr/www/users/my_user/index.php:53] Gdn_Dispatcher->Dispatch();

Variables in local scope:
[Sql] 'select d.Type as `Type`, d.InsertUserID as `FirstUserID`, d.DateInserted as `FirstDate`, d.CountBookmarks as `CountBookmarks`, d.Body as `Body`, d.Format as `Format`, d.DateLastComment as `LastDate`, d.LastCommentUserID as `LastUserID`, d.Score as `Score`, iu.Email as `FirstEmail`, lcu.Email as `LastEmail`, d.*, w.UserID as `WatchUserID`, w.DateLastViewed as `DateLastViewed`, w.Dismissed as `Dismissed`, w.Bookmarked as `Bookmarked`, w.CountComments as `CountCommentWatch`
from GDN_Discussion d
left join GDN_UserDiscussion w on d.DiscussionID = w.DiscussionID and w.UserID = 2
where d.DiscussionID in (\'36\', \'41\', \'68\', \'190\', \'230\', \'279\', \'318\', \'334\', \'348\', \'355\', \'358\', \'360\', \'366\', \'368\', \'375\', \'377\', \'378\', \'398\', \'404\', \'406\', \'408\', \'409\', \'420\', \'431\', \'439\', \'455\', \'483\', \'499\')
and w.Bookmarked = :wBookmarked
order by d.DateLastComment desc
limit 10'
[InputParameters] array (
':wBookmarked' => '1',
)
[Options] array (
'ReturnType' => 'DataSet',
)
[ReturnType] 'DataSet'
[PDOStatement] array (
'queryString' => 'select d.Type as `Type`, d.InsertUserID as `FirstUserID`, d.DateInserted as `FirstDate`, d.CountBookmarks as `CountBookmarks`, d.Body as `Body`, d.Format as `Format`, d.DateLastComment as `LastDate`, d.LastCommentUserID as `LastUserID`, d.Score as `Score`, iu.Email as `FirstEmail`, lcu.Email as `LastEmail`, d.*, w.UserID as `WatchUserID`, w.DateLastViewed as `DateLastViewed`, w.Dismissed as `Dismissed`, w.Bookmarked as `Bookmarked`, w.CountComments as `CountCommentWatch`
from GDN_Discussion d
left join GDN_UserDiscussion w on d.DiscussionID = w.DiscussionID and w.UserID = 2
where d.DiscussionID in (\'36\', \'41\', \'68\', \'190\', \'230\', \'279\', \'318\', \'334\', \'348\', \'355\', \'358\', \'360\', \'366\', \'368\', \'375\', \'377\', \'378\', \'398\', \'404\', \'406\', \'408\', \'409\', \'420\', \'431\', \'439\', \'455\', \'483\', \'499\')
and w.Bookmarked = :wBookmarked
order by d.DateLastComment desc
limit 10',
)

Additional information for support personnel:
Application: Vanilla
Application Version: 2.0.18.1
PHP Version: 5.3.8
Operating System: Linux
Server Software: Apache
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2
Request Uri: /
Controller: Gdn_Database
Method: Query