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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Module Newsletter 0.5 - Error while storing the email


Go to End


993 Views

Avatar
maga

Community Member, 11 Posts

13 March 2014 at 11:12pm

I am using Silverstripe version 2.4.9 I copied the folder newsletters (version 0.5) from an old project done in SilverStripe 2.4.6 where the module worked perfectly, but in the new project, the module does not work while I store the email from the form, the server gives me this error:

============ ERROR ==============================================

User Error] Member::generateAutologinHash is deprecated - tokens are no longer saved directly into the database in plaintext. Use the return value of the Member::generateAutologinTokenAndHash to get the token instead.
POST /SilverStripe/contatti/newsletter-contatti/SubscriptionForm

Line 489 in C:\wamp\www\SilverStripe\sapphire\security\Member.php

Source

480
481 /**
482 * @deprecated 2.4
483 */
484 public function generateAutologinHash($lifetime = 2) {
485 user_error(
486 'Member::generateAutologinHash is deprecated - tokens are no longer saved directly into the database '.
487 'in plaintext. Use the return value of the Member::generateAutologinTokenAndHash to get the token '.
488 'instead.',
489 E_USER_ERROR);

============ END ERROR ============================================

This is the function called by the template

......
$getNewsletter
...........

Page.php

public function getNewsletter() {
$newsletter = $this->Children()->First();
if ($newsletter){
$formController = new SubscriptionPage_Controller($newsletter);
return $formController->SubscriptionForm()->fortemplate();
// or return $formController->Form()->renderWith('Form', 'your customise form template');
}
}

Does anyone know help me?
Thanks in advance to all for the help.
greetings
sorceress