2016-09-23 55 views

回答

3

这是问题所在,并解决这个bug:

当我们进入一个新的电子邮件地址(未连接到extisting用户一个),用户对象($这个)有没有id ($ this-> getId(); // null)尚未在Magento \ Newsletter \ Model \ Subscriber :: subscribe

验证邮件在用户保存之前发送出去,因此验证链接中缺少用户标识。当您点击该链接时,链接不会执行任何操作,因为Magento \ Newsletter \ Controller \ Subscriber \ Confirm ::执行中的验证方法会因为缺少ID而拒绝链接。

在致电$ this-> sendConfirmationRequestEmail()之前,您可以通过调用$ this-> save()轻松修复问题。

try { 
      $this->save(); 
      if($isConfirmNeed === true && $isOwnSubscribes === false) 
      { 
       $this->sendConfirmationRequestEmail(); 
      } else { 
       $this->sendConfirmationSuccessEmail(); 
      } 
      return $this->getStatus(); 
     } catch (\Exception $e) { 
      throw new \Exception($e->getMessage()); 
     } 

我干脆搬到了'拯救“”' - 叫了几行了。 sendConfirmationRequestEmailsendConfirmationSuccessEmail似乎不会改变$ thisobject,所以这是一个有效的更改,不会破坏其他任何东西。