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

Module Newsletter 0.5 - Error while storing the email


Reply

285 Views

Avatar
maga

13 March 2014 at 11:12pm Community Member, 11 Posts

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