Forgot password does not work in magento 1.9.0.1 - magento-1.9.1

Hi when customers click on "forgot Password" they receive the email with a link to reset. When clicked this is the error that they are receiving. Fatal error: Call to a member function setCustomerId() on a non-object in /home/ishieldz/public_html/store/app/code/core/Mage/Customer/controllers/AccountController.php on line 750
Any help would be appreciated. Thank you!
/**
* Display reset forgotten password form
*
* User is redirected on this action when he clicks on the corresponding link in password reset confirmation email
*
/
public function resetPasswordAction()
{
$resetPasswordLinkToken = (string) $this->getRequest()->getQuery('token');
$customerId = (int) $this->getRequest()->getQuery('id');
try {
$this->_validateResetPasswordLinkToken($customerId, $resetPasswordLinkToken);
$this->loadLayout();
// Pass received parameters to the reset forgotten password form
$this->getLayout()->getBlock('resetPassword')
->setCustomerId($customerId)
->setResetPasswordLinkToken($resetPasswordLinkToken);
$this->renderLayout();
} catch (Exception $exception) {
$this->_getSession()->addError( $this->_getHelper('customer')->__('Your password reset link has expired.'));
$this->_redirect('/*/forgotpassword');
}
}

If you are in Magento 1.9.1 Here is a solution which worked for me.
If your theme doesn’t include any specific custom config or layout settings you can safely delete your customer.xml (or just rename to customer1.xml) file located at /app/design/frontend/default/<your_theme_package>/<your_theme_name>/layout/customer.xml
If you delete this file magento will load the default config options
(with the updates) from the factory default magento theme.
/app/design/frontend/base/default/layout/customer.xml
Remember to flush / refresh your magento config via administration area, this will force the customer.xml file to be reloaded.

It seems that your invoking an udeclared object, so maybe it's only a variable.
Verify if you're declaring your object before the line 750 in your AccountController.php
You must put the declaration of the object (Example: $ob = new Customer();)
that contains the setCustomerId() method, into the method that is running.

login to magento. go to system, design. Delete your current theme and then re-add again.

Related

Prestashop 1.7 hook on admin product

I have a error on my custom module.
I need to put a extra text on product admin page.
I have use the hook "hookDisplayAdminProductsMainStepLeftColumnMiddle", and it display my tpl with the info (on the image, it is the text "Información adicional relacionada").
The problem is, when the module is active the product admin page not finish of charge.
So I can't save the product or do anything.
This is the code of the hook
public function hookDisplayAdminProductsMainStepLeftColumnMiddle($params)
{
$product = new Product($params['id_product']);
$this->context->smarty->assign(array(
'product ' => $product,
)
);
return $this->display($this->_path, '/views/templates/admin/admininfo.tpl');
}
If I comment only the line "return ....", of course it doesn't display, but the product page charge properly.
On the tpl I write only a text, I don't put yet even a variable.
The other code seems to works properly. I have commented the javascript code on my module.
Nor errors or warnings on the console or even on logs.
I have actived the debbug mode, but not even there display any error.
Any idea or suggest will be grateful!
Try using :
$tpl = $this->context->smarty->createTemplate(
dirname(__FILE__).'/views/templates/admin/yourtemplate.tpl'
);
And then :
return $tpl->fetch();

How to configure ZK form to show browser cache data?

I am new to ZK framework. As per my requirement, I need to convert JSP-Servlet based application into ZK framework. One requirement is I need to show previously filled data [stored in browser cache] in forms input boxes when user click in that input box or type similar characters.
This was the default behavior in the JSP-Servlet application or any other HTML based GUI. But by default ZK form does not show previously filled data. I tried some googling to find its solution but could not found any. Please provide me the solution for that.
Thanks in advance :)
You can use cookies for that.
Here is a link to the documentation of cookies for zk.
Code provided in the link :
public void onCookie(){
try {
//add cookie
HttpServletResponse response = (HttpServletResponse)Executions.getCurrent().getNativeResponse();
Cookie userCookie = new Cookie("user", "xxx123");
response.addCookie(userCookie);
//get cookie
Cookie [] cookies = ((HttpServletRequest)Executions.getCurrent().getNativeRequest()).getCookies();
System.out.println(cookies[0].getName());
} catch (Exception e) {
e.printStackTrace();
}
}

Phpbb new successful member registration pop up window

I would like to create a pop up welcome message for the new member that's successfully registered.
But I m having problem of finding where should I put the code, I have check the ucp_register.html ,, but I don't think that is the display content after the member successfully registered, can anyone help me please? Thanks
It would likely to be a more robust solution to display the popup on the first time the user is logged in as an activated user -- after registration they may not be activated, or they may close the browser window immediately after registration.
The way to do this would be to add a column (say, user_JBL_seen_message INT to the phpbb_users table in the database, then modify functions.php to check that column:
In functions.php, find:
// The following assigns all _common_ variables that may be used at any point in a template.
Before, add:
if($user->data['is_registered'] && $user->data['is_active'] && !$user->data['is_bot'])
{
if(isset($user->data['user_JBL_seen_message']) && !$user->data['user_JBL_seen_message']))
{
$showPopup = true;
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_JBL_seen_message = 1
WHERE user_id = ' . (int)$user->data['user_id'];
if (!$result = $db->sql_query($sql))
{
return false;
}
}
}
Then, find:
$template->assign_vars(array(
After, add:
'JBL_POPUP' => $showPopup,
Then, you can add the popup HTML code to your overall_header.html template file, where appropriate...
<!-- IF JBL_POPUP -->
.... your HTML popup code here.....
<!-- END IF -->
If you don't want existing users to see the popup, then fill the new column with 1s.
I also agree with Damien's suggestion to use a jQuery UI dialog rather than a popup -- most users' browsers will block popups. However, use jQuery in noconflict mode to avoid conflicts with other mods.

Apache wicket validation

I have custom validation added to my page, and this validation is called from business logic layer, after I click "Save" button on UI, which is AjaxSubmitLink.
On my page I have apache wicket DateTimeField, but it's validation doesn't work correctly: error message doesn't appear in FeedbackPanel, which is added on page and my custom validation is shown there correctly.
So for example I fill hours field with "321" and I will have error in console:
WARN org.apache.wicket.protocol.http.WebSession -
Component-targetted feedback message was left unrendered. This could
be because you are missing a FeedbackPanel on the page. Message:
[FeedbackMessage message = "Translation for key [hours.RangeValidator]
is not found for language [en]!", reporter = hours, level = ERROR]
Maybe someone had similar problems and have solution for this?
Thanks!
Because you do an Ajax-Request you have to add the feedback-panel to your AjaxRequestTarget (so it will update itself on every request).
You have to override the onError method though:
add(new AjaxSubmitLink() {
#Override
protected void onError(final AjaxRequestTarget target, final Form form) {
target.addComponent(yourFeedbackPanel);
}
}

Captcha image and raw format

I've trying to get properly work kcaptcha class from kcaptcha.ru in my own component. 'Cause class not build for Joomla natively I break my brain on the wall.
And at the beginning...
I've a url to image generated by this class like: http://.../index.php&task=captcha&format=raw
In main controller I've put method
function captcha() {
include(JPATH_COMPONENT.DS.'libraries'.DS.'captcha'.DS.'kcaptcha'.DS.'kcaptcha.php');
$session = &JSession::getInstance('default', array());
$captcha = new KCAPTCHA();
if ($session) {
$session->set('captcha_keystring', $captcha->getKeyString());
}
}
And I've see in browser
When I request an image from the class all working good but in my component I cannot set session variables.
Any ideas how to fix this problem?
And problem solved successfully.
For &format=raw in controller Joomla set default mime-type to text/html.
For healing this issue developer must reset mime/type via setting
$document = &JFactory::getDocument();
$document->setMimeEncoding('image/png');
mime/encoding off course depends on you needs.