【问题标题】:Forgot password does not work in magento 1.9.0.1忘记密码在 magento 1.9.0.1 中不起作用
【发布时间】:2014-07-16 17:06:25
【问题描述】:

您好,当客户点击“忘记密码”时,他们会收到包含重置链接的电子邮件。单击时,这是他们收到的错误。致命错误:在第 750 行的 /home/ishieldz/public_html/store/app/code/core/Mage/Customer/controllers/AccountController.php 中的非对象上调用成员函数 setCustomerId() 任何帮助,将不胜感激。谢谢!

/** * 显示重置忘记密码表格 * * 当用户点击密码重置确认邮件中的相应链接时,用户会被重定向到此操作 * / 公共函数resetPasswordAction() { $resetPasswordLinkToken = (string) $this->getRequest()->getQuery('token'); $customerId = (int) $this->getRequest()->getQuery('id'); 尝试 { $this->_validateResetPasswordLinkToken($customerId, $resetPasswordLinkToken); $this->loadLayout(); // 将接收到的参数传递给重置忘记密码表单 $this->getLayout()->getBlock('resetPassword') ->setCustomerId($customerId) ->setResetPasswordLinkToken($resetPasswordLinkToken); $this->renderLayout(); } 捕捉(异常 $exception){ $this->_getSession()->addError( $this->_getHelper('customer')->__('您的密码重置链接已过期')); $this->_redirect('/*/forgotpassword'); } }

【问题讨论】:

    标签: magento-1.9.1


    【解决方案1】:

    如果您使用的是 Magento 1.9.1,这是一个对我有用的解决方案。

    如果您的主题不包含任何特定的自定义配置或布局设置,您可以安全地删除位于 /app/design/frontend/default/<your_theme_package>/<your_theme_name>/layout/customer.xml 的 customer.xml(或只是重命名为 customer1.xml)文件

    如果你删除这个文件,magento 会加载默认的配置选项 (带有更新)来自出厂默认的 magento 主题。 /app/design/frontend/base/default/layout/customer.xml

    记得通过管理区域刷新/刷新您的 magento 配置,这将强制重新加载 customer.xml 文件。

    【讨论】:

    • 这解决了我的问题。
    【解决方案2】:

    您似乎调用了一个未声明的对象,所以它可能只是一个变量。 验证您是否在 AccountController.php 中的第 750 行之前声明您的对象

    你必须把对象的声明(例如:$ob = new Customer();) 将包含 setCustomerId() 方法的内容放入正在运行的方法中。

    【讨论】:

    • 我从文件中添加了上面的代码。这是 Magento 1.9.0.1 默认的
    【解决方案3】:

    登录到magento。进入系统,设计。删除您当前的主题,然后重新添加。

    【讨论】:

      猜你喜欢
      • 2014-06-07
      • 1970-01-01
      • 2016-07-25
      • 2012-06-09
      • 2016-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-16
      相关资源
      最近更新 更多