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.

All other Modules /

Discuss all other Modules here.

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

[newsletter] - error while duplicate user


Reply


3 Posts   935 Views

Avatar
sebastiankozub

Community Member, 40 Posts

17 November 2010 at 8:25am

Hi, I have standard newsletter installed and when somebody want to add his e-mail second time and he's now in database I get error instead of nice information :(
How can I change it to have page that inform user that he's in database?

Source

618             'Member',
619             sprintf(
620                "\"%s\" = '%s' %s",
621                $identifierField,
622                Convert::raw2sql($this->$identifierField),
623                $idClause
624             )
625          );
626          if($existingRecord) {
627             throw new ValidationException(new ValidationResult(false, sprintf(
628                _t(
629                   'Member.ValidationIdentifierFailed',
630                   'Can\'t overwrite existing member #%d with identical identifier (%s = %s))',
631                   PR_MEDIUM,
632                   'The values in brackets show a fieldname mapped to a value, usually denoting an existing email address'
633                ),

Trace

* Member->onBeforeWrite()
Line 936 of DataObject.php
* DataObject->write()
Line 238 of SubscriptionPage.php
* SubscriptionPage_Controller->doSubscribe(Array,Form,SS_HTTPRequest)
Line 300 of Form.php
* Form->httpSubmission(SS_HTTPRequest)
Line 137 of RequestHandler.php
* RequestHandler->handleRequest(SS_HTTPRequest)
Line 155 of RequestHandler.php
* RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 199 of ContentController.php
* ContentController->handleRequest(SS_HTTPRequest)
Line 67 of ModelAsController.php
* ModelAsController->handleRequest(SS_HTTPRequest)
Line 281 of Director.php
* Director::handleRequest(SS_HTTPRequest,Session)
Line 124 of Director.php
* Director::direct(/newsletter/Form)
Line 127 of main.php

Avatar
nimeso

Community Member, 17 Posts

3 December 2010 at 11:37pm

I have the same but different issue...

I have Wills Facebook Connect Module, and if I log in as test@test.com using 'standard' login form I successfully login.

But then if I click the Facebook button and type a different email (SS & facebook vaild) eg vaildfb@vaildfb.com my page refreshes and freaks out cos it's a different vaild user? . Same error... What I want is it to reload/login as new facebook user?

I don't want to hack FaceBookMember.php or Member.php surely?

Please help drivin me crazy man!

Jamie

Avatar
CHD

Community Member, 218 Posts

11 June 2011 at 4:05am

this may come in handy for anybody who wants to easily include forms in a sidebar or any other area of the site, without controlling a hidden page:

http://www.clickheredigital.co.uk/blog/how-to-include-a-silverstripe-form-on-any-every-page/

it also has an easy "query database for existing member" function that isn't covered in the form tutorials...