Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Error after adding custom field #177

Open
MLindenhofer opened this issue Jun 30, 2021 · 0 comments
Open

DB Error after adding custom field #177

MLindenhofer opened this issue Jun 30, 2021 · 0 comments

Comments

@MLindenhofer
Copy link

MLindenhofer commented Jun 30, 2021

Hi,
CMS: SilverStripe 3.7.3, PHP: 7.2

I followed the instructions from the docs to add a custom field - in my case a CheckboxField "TermAgreement":

private static $db = [
    	...
	   'TermAgreement' => 'Boolean',
      ...
    ];


 public function updateMemberFormFields($fields) {
 
		$TermAgreementField = CheckboxField::create('TermAgreement', 'I agree that all my comments and articles, if editorially accepted for publication, shall be licensed under the CC-BY Creative Commons Attribution License 4.0.');
		$fields->push($TermAgreementField);
    }

but when I do a dev/build?flush to add the new MemberField to the DB too this Error is thrown:

[User Error] Uncaught SS_DatabaseException: Couldn't run query: SELECT DISTINCT "Member"."ClassName", "Member"."LastEdited", "Member"."Created", "Member"."FirstName", "Member"."Surname", "Member"."Email", "Member"."TempIDHash", "Member"."TempIDExpired", "Member"."Password", "Member"."RememberLoginToken", "Member"."NumVisit", "Member"."LastVisited", "Member"."AutoLoginHash", "Member"."AutoLoginExpired", "Member"."PasswordEncryption", "Member"."Salt", "Member"."PasswordExpiry", "Member"."LockedOutUntil", "Member"."Locale", "Member"."FailedLoginCount", "Member"."DateFormat", "Member"."TimeFormat", "Member"."Degree", "Member"."Institution", "Member"."TermAgreement", "Member"."Position", "Member"."OrcidID", "Member"."ContactDetails", "Member"."AreaOfExpertise", "Member"."References", "Member"."ReviewStatusRequested", "Member"."Verification", "Member"."IsPublic", "Member"."HasPublished", "Member"."ValidationKey", "Member"."NeedsValidation", "Member"."NeedsApproval", "Member"."PublicFieldsRaw", "Member"."ProfileImageID", "Member"."ProfilePageID", "Member"."ID", CASE WHEN "Member"."ClassName" IS NOT NULL THEN "Member"."ClassName" ELSE 'Member' END AS "RecordClassName" FROM "Member" WHERE ("Member"."ID" = ?) ORDER BY "Member"."Surname" ASC, "Member"."FirstName" ASC LIMIT 1 Unknown column 'Member.TermAgreement' in 'field list'
GET /dev/build?devbuildtoken=558c54c2cef98dca1dec0ea5056c0d5f
Line 55 in /vagrant/www/framework/model/connect/DBConnector.php

Reinstalling the module, each time I want to add a CustomField like #161 can't be the only solution? What can I do? Help please,

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant