Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Forum Module /

Discuss the Forum Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Forum doesn't work with silverstripe 2.4


Reply


6 Posts   1251 Views

Avatar
vancouverWill

Community Member, 121 Posts

26 November 2009 at 1:16pm

[User Error] Couldn't run query: SELECT "Member"."ClassName", "Member"."Created", "Member"."LastEdited", "Member"."FirstName", "Member"."Surname", "Member"."Email", "Member"."Password", "Member"."RememberLoginToken", "Member"."NumVisit", "Member"."LastVisited", "Member"."Bounced", "Member"."AutoLoginHash", "Member"."AutoLoginExpired", "Member"."PasswordEncryption", "Member"."Salt", "Member"."PasswordExpiry", "Member"."LockedOutUntil", "Member"."Locale", "Member"."FailedLoginCount", "Member"."ForumRank", "Member"."Occupation", "Member"."Company", "Member"."City", "Member"."Country", "Member"."Nickname", "Member"."FirstNamePublic", "Member"."SurnamePublic", "Member"."OccupationPublic", "Member"."CompanyPublic", "Member"."CityPublic", "Member"."CountryPublic", "Member"."EmailPublic", "Member"."LastViewed", "Member"."Signature", "Member"."AvatarID", "Member"."ID", CASE WHEN "Member"."ClassName" IS NOT NULL THEN "Member"."ClassName" ELSE 'Member' END AS "RecordClassName" FROM "Member" WHERE ("Member"."ID" = 1) ORDER BY "Surname", "FirstName" LIMIT 1 Unknown column 'Member.ForumRank' in 'field list'

GET /admin/security/

Line 535 in C:\xampp\htdocs\xampp\silverstripe\social_network\sapphire\core\model\MySQLDatabase.php

Avatar
Double-A-Ron

Community Member, 604 Posts

26 November 2009 at 6:25pm

Edited: 26/11/2009 6:26pm

You'll need to be more specific if you want anyone to help.

Where are you seeing this error?
How can people duplicate this?
How have you installed forum?

I have just installed Forum 0.2.4 on SS 2.4a and without testing too much, all is fine and the ForumRank field that is causing the error above is present in my Database.

Also remember 2.4 is alpha. It's not stable but I'm sure the devs will appreciate it if we find a bug here.

Aaron

Avatar
ajshort

Community Member, 244 Posts

26 November 2009 at 9:07pm

Actually, all that information is provided in the error message (it provides the URL etc. as well). Did you run /dev/build after you installed 2.4/the forum module? Also, what version of the forum are you running?

Avatar
vancouverWill

Community Member, 121 Posts

27 November 2009 at 1:21pm

Thanks for the quick replies.

The only other modules I have installed are the registeration module and sharethis, I only have one really simple file in mysite/code/ which extends DataObjectDecorator { to expand the member table.

I have forum-v0.2.4, SilverStripe-v2.4.0-alpha1 and figured maybe I was being helpful posting this as it is alpha version of SS. I'm not that worried that I can't use forum with this, I'll just go back to 2.3 for now. Having said that you are saying that you have it working fine with your setup so I'm not sure where it went wrong. I get the same error on every page including dev/build/.

The complete error is

[User Error] Couldn't run query: SELECT "Member"."ClassName", "Member"."Created", "Member"."LastEdited", "Member"."FirstName", "Member"."Surname", "Member"."Email", "Member"."Password", "Member"."RememberLoginToken", "Member"."NumVisit", "Member"."LastVisited", "Member"."Bounced", "Member"."AutoLoginHash", "Member"."AutoLoginExpired", "Member"."PasswordEncryption", "Member"."Salt", "Member"."PasswordExpiry", "Member"."LockedOutUntil", "Member"."Locale", "Member"."FailedLoginCount", "Member"."ForumRank", "Member"."Occupation", "Member"."Company", "Member"."City", "Member"."Country", "Member"."Nickname", "Member"."FirstNamePublic", "Member"."SurnamePublic", "Member"."OccupationPublic", "Member"."CompanyPublic", "Member"."CityPublic", "Member"."CountryPublic", "Member"."EmailPublic", "Member"."LastViewed", "Member"."Signature", "Member"."AvatarID", "Member"."ID", CASE WHEN "Member"."ClassName" IS NOT NULL THEN "Member"."ClassName" ELSE 'Member' END AS "RecordClassName" FROM "Member" WHERE ("Member"."ID" = 1) ORDER BY "Surname", "FirstName" LIMIT 1 Unknown column 'Member.ForumRank' in 'field list'
GET /dev/build

Line 535 in C:\xampp\htdocs\xampp\silverstripe\social_network\sapphire\core\model\MySQLDatabase.php
Source

526    }
527    
528    function databaseError($msg, $errorLevel = E_USER_ERROR) {
529       // try to extract and format query
530       if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
531          $formatter = new SQLFormatter();
532          $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
533       }
534       
535       user_error($msg, $errorLevel);
536    }
537    
538    /**
539     * Return a boolean type-formatted string
540     *
541     * @param array $values Contains a tokenised list of info about this data type

Trace

* Couldn't run query: SELECT "Member"."ClassName", "Member"."Created", "Member"."LastEdited", "Member"."FirstName", "Member"."Surname", "Member"."Email", "Member"."Password", "Member"."RememberLoginToken", "Member"."NumVisit", "Member"."LastVisited", "Member"."Bounced", "Member"."AutoLoginHash", "Member"."AutoLoginExpired", "Member"."PasswordEncryption", "Member"."Salt", "Member"."PasswordExpiry", "Member"."LockedOutUntil", "Member"."Locale", "Member"."FailedLoginCount", "Member"."ForumRank", "Member"."Occupation", "Member"."Company", "Member"."City", "Member"."Country", "Member"."Nickname", "Member"."FirstNamePublic", "Member"."SurnamePublic", "Member"."OccupationPublic", "Member"."CompanyPublic", "Member"."CityPublic", "Member"."CountryPublic", "Member"."EmailPublic", "Member"."LastViewed", "Member"."Signature", "Member"."AvatarID", "Member"."ID", CASE WHEN "Member"."ClassName" IS NOT NULL THEN "Member"."ClassName" ELSE 'Member' END AS "RecordClassName" FROM "Member" WHERE ("Member"."ID" = 1) ORDER BY "Surname", "FirstName" LIMIT 1 Unknown column 'Member.ForumRank' in 'field list'
Line 535 of MySQLDatabase.php
* MySQLDatabase->databaseError(Couldn't run query: SELECT "Member"."ClassName", "Member"."Created", "Member"."LastEdited", "Member"."FirstName", "Member"."Surname", "Member"."Email", "Member"."Password", "Member"."RememberLoginToken", "Member"."NumVisit", "Member"."LastVisited", "Member"."Bounced", "Member"."AutoLoginHash", "Member"."AutoLoginExpired", "Member"."PasswordEncryption", "Member"."Salt", "Member"."PasswordExpiry", "Member"."LockedOutUntil", "Member"."Locale", "Member"."FailedLoginCount", "Member"."ForumRank", "Member"."Occupation", "Member"."Company", "Member"."City", "Member"."Country", "Member"."Nickname", "Member"."FirstNamePublic", "Member"."SurnamePublic", "Member"."OccupationPublic", "Member"."CompanyPublic", "Member"."CityPublic", "Member"."CountryPublic", "Member"."EmailPublic", "Member"."LastViewed", "Member"."Signature", "Member"."AvatarID", "Member"."ID", CASE WHEN "Member"."ClassName" IS NOT NULL THEN "Member"."ClassName" ELSE 'Member' END AS "RecordClassName" FROM "Member" WHERE ("Member"."ID" = 1) ORDER BY "Surname", "FirstName" LIMIT 1 | Unknown column 'Member.ForumRank' in 'field list',256)
Line 133 of MySQLDatabase.php
* MySQLDatabase->query(SELECT "Member"."ClassName", "Member"."Created", "Member"."LastEdited", "Member"."FirstName", "Member"."Surname", "Member"."Email", "Member"."Password", "Member"."RememberLoginToken", "Member"."NumVisit", "Member"."LastVisited", "Member"."Bounced", "Member"."AutoLoginHash", "Member"."AutoLoginExpired", "Member"."PasswordEncryption", "Member"."Salt", "Member"."PasswordExpiry", "Member"."LockedOutUntil", "Member"."Locale", "Member"."FailedLoginCount", "Member"."ForumRank", "Member"."Occupation", "Member"."Company", "Member"."City", "Member"."Country", "Member"."Nickname", "Member"."FirstNamePublic", "Member"."SurnamePublic", "Member"."OccupationPublic", "Member"."CompanyPublic", "Member"."CityPublic", "Member"."CountryPublic", "Member"."EmailPublic", "Member"."LastViewed", "Member"."Signature", "Member"."AvatarID", "Member"."ID", CASE WHEN "Member"."ClassName" IS NOT NULL THEN "Member"."ClassName" ELSE 'Member' END AS "RecordClassName" FROM "Member" WHERE ("Member"."ID" = 1) ORDER BY "Surname", "FirstName" LIMIT 1,256)
Line 135 of DB.php
* DB::query(SELECT "Member"."ClassName", "Member"."Created", "Member"."LastEdited", "Member"."FirstName", "Member"."Surname", "Member"."Email", "Member"."Password", "Member"."RememberLoginToken", "Member"."NumVisit", "Member"."LastVisited", "Member"."Bounced", "Member"."AutoLoginHash", "Member"."AutoLoginExpired", "Member"."PasswordEncryption", "Member"."Salt", "Member"."PasswordExpiry", "Member"."LockedOutUntil", "Member"."Locale", "Member"."FailedLoginCount", "Member"."ForumRank", "Member"."Occupation", "Member"."Company", "Member"."City", "Member"."Country", "Member"."Nickname", "Member"."FirstNamePublic", "Member"."SurnamePublic", "Member"."OccupationPublic", "Member"."CompanyPublic", "Member"."CityPublic", "Member"."CountryPublic", "Member"."EmailPublic", "Member"."LastViewed", "Member"."Signature", "Member"."AvatarID", "Member"."ID", CASE WHEN "Member"."ClassName" IS NOT NULL THEN "Member"."ClassName" ELSE 'Member' END AS "RecordClassName" FROM "Member" WHERE ("Member"."ID" = 1) ORDER BY "Surname", "FirstName" LIMIT 1,256)
Line 386 of SQLQuery.php
* SQLQuery->execute()
Line 2765 of DataObject.php
* DataObject->instance_get_one("Member"."ID" = 1,)
Line 2696 of DataObject.php
* DataObject::get_one(Member,"Member"."ID" = 1)
Line 457 of Member.php
* Member::currentUser()
Line 85 of Controller.php
* Controller->init()
Line 20 of DevelopmentAdmin.php
* DevelopmentAdmin->init()
Line 139 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 282 of Director.php
* Director::handleRequest(SS_HTTPRequest,Session)
Line 127 of Director.php
* Director::direct(/dev/build)
Line 122 of main.php

Thanks

Will

Avatar
Willr

Forum Moderator, 5513 Posts

27 November 2009 at 8:31pm

If the database is a new one and you're logged in I think the error could be that there is a DataObject::get('Member'): before the member table has been updated. Try creating a column in your database (via phpmyadmin or something) doesn't matter what type of field you create just name it 'ForumRank' then try site.com/dev/build.

Avatar
vancouverWill

Community Member, 121 Posts

1 December 2009 at 6:58am

Perfect. That did the trick.