Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » Module Newsletter 0.5 - Error while storing the email

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 231 Views
  • maga
    Avatar
    Community Member
    11 Posts

    Module Newsletter 0.5 - Error while storing the email Link to this post

    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

    231 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.